diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 8466215fc..1bcca458c 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -385,10 +385,9 @@ var exitLock = sync.Mutex{} // // force:是否不执行同步过程而直接退出 // execInstallPkg:是否执行新版本安装包 -// -// 0:默认按照设置项 System.DownloadInstallPkg 检查并推送提示 -// 1:不执行新版本安装 -// 2:执行新版本安装 +// 0:默认按照设置项 System.DownloadInstallPkg 检查并推送提示 +// 1:不执行新版本安装 +// 2:执行新版本安装 func Close(force bool, execInstallPkg int) (exitCode int) { exitLock.Lock() defer exitLock.Unlock() @@ -434,7 +433,12 @@ func Close(force bool, execInstallPkg int) (exitCode int) { go func() { time.Sleep(500 * time.Millisecond) if waitSecondForExecInstallPkg { - time.Sleep(1 * time.Second) + time.Sleep(2 * time.Second) + if gulu.OS.IsWindows() { + // Windows 端退出拉起更新安装时有时需要重启两次 https://github.com/siyuan-note/siyuan/issues/6467 + // 这里多等待一段时间,等待安装程序启动后时会在 NSIS 自定义脚本中 Kill SiYuan 进程,详见 install.nsh + time.Sleep(5 * time.Second) + } } logging.LogInfof("exited kernel") util.WebSocketServer.Close()