From 8646bb0b10354637a080933f21c00b250f026cf9 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 31 Jul 2024 12:24:17 +0800 Subject: [PATCH] :art: Improve indexing completeness when exiting https://github.com/siyuan-note/siyuan/issues/12039 --- kernel/model/conf.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 8c5fa7dd1..cd1585e07 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -610,6 +610,9 @@ func Close(force, setCurrentWorkspace bool, execInstallPkg int) (exitCode int) { // Close the user guide when exiting https://github.com/siyuan-note/siyuan/issues/10322 closeUserGuide() + // Improve indexing completeness when exiting https://github.com/siyuan-note/siyuan/issues/12039 + sql.WaitForWritingDatabase() + util.IsExiting.Store(true) waitSecondForExecInstallPkg := false if !skipNewVerInstallPkg() { @@ -1083,8 +1086,6 @@ func closeUserGuide() { logging.LogErrorf("remove corrupted user guide box [%s] failed: %s", boxDirPath, removeErr) } - sql.WaitForWritingDatabase() - util.PushClearMsg(msgId) logging.LogInfof("closed user guide box [%s]", boxID) }