🎨 Windows 端退出拉起更新安装时有时需要重启两次 Fix https://github.com/siyuan-note/siyuan/issues/6467

This commit is contained in:
Liang Ding 2022-11-03 15:10:40 +08:00
parent 85262863ee
commit f3bcdb1d39
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -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()