🎨 Improve system exit

This commit is contained in:
Daniel 2023-06-09 20:36:21 +08:00
parent e99035d727
commit e28d0dc075
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -501,16 +501,17 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
clearPortJSON() clearPortJSON()
util.UnlockWorkspace() util.UnlockWorkspace()
go func() {
time.Sleep(500 * time.Millisecond) time.Sleep(500 * time.Millisecond)
if waitSecondForExecInstallPkg { if waitSecondForExecInstallPkg {
util.PushMsg(Conf.Language(130), 1000*5) util.PushMsg(Conf.Language(130), 1000*5)
// 桌面端退出拉起更新安装时有时需要重启两次 https://github.com/siyuan-note/siyuan/issues/6544 // 桌面端退出拉起更新安装时有时需要重启两次 https://github.com/siyuan-note/siyuan/issues/6544
// 这里多等待一段时间,等待安装程序启动 // 这里多等待一段时间,等待安装程序启动
time.Sleep(5 * time.Second) time.Sleep(4 * time.Second)
} }
logging.LogInfof("exited kernel") logging.LogInfof("exited kernel")
util.WebSocketServer.Close() util.WebSocketServer.Close()
go func() {
time.Sleep(500 * time.Millisecond)
os.Exit(logging.ExitCodeOk) os.Exit(logging.ExitCodeOk)
}() }()
return return