Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: 退出应用时数据库未完全写入 https://github.com/siyuan-note/siyuan/issues/6318

Liang Ding83999184e04b
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index 72f69d9840..e489ca151a 100644
--- a/kernel/model/conf.go
+++ b/kernel/model/conf.go
@@ -361,18 +361,9 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
defer exitLock.Unlock()
logging.LogInfof("exiting kernel [force=%v, execInstallPkg=%d]", force, execInstallPkg)
-
util.PushMsg(Conf.Language(95), 10000*60)
+ WaitForWritingFiles()
- wg := sync.WaitGroup{}
- go func() {
- wg.Add(1)
- time.Sleep(util.FrontendQueueInterval + 50*time.Millisecond)
- WaitForWritingFiles()
- time.Sleep(50 * time.Millisecond)
- sql.WaitForWritingDatabase()
- wg.Done()
- }()
if !force {
SyncData(false, true, false)
if 0 != ExitSyncSucc {
@@ -380,7 +371,6 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
return
}
}
- wg.Wait()
//util.UIProcessIDs.Range(func(key, _ interface{}) bool {
// pid := key.(string)