From f3bcdb1d39a68e2c7c93b3235aefcdf082b13037 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 3 Nov 2022 15:10:40 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20Windows=20=E7=AB=AF=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=8B=89=E8=B5=B7=E6=9B=B4=E6=96=B0=E5=AE=89=E8=A3=85=E6=97=B6?= =?UTF-8?q?=E6=9C=89=E6=97=B6=E9=9C=80=E8=A6=81=E9=87=8D=E5=90=AF=E4=B8=A4?= =?UTF-8?q?=E6=AC=A1=20Fix=20https://github.com/siyuan-note/siyuan/issues/?= =?UTF-8?q?6467?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/conf.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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()