mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-12 23:46:13 +01:00
🐛 桌面端拉起自动更新安装包偶尔失败 Fix https://github.com/siyuan-note/siyuan/issues/5996
This commit is contained in:
parent
da392ba0d2
commit
400fc166b2
2 changed files with 6 additions and 2 deletions
|
|
@ -379,6 +379,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
|||
// return true
|
||||
//})
|
||||
|
||||
waitSecondForExecInstallPkg := false
|
||||
if !skipNewVerInstallPkg() {
|
||||
newVerInstallPkgPath := getNewVerInstallPkgPath()
|
||||
if "" != newVerInstallPkgPath {
|
||||
|
|
@ -387,6 +388,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
|||
logging.LogInfof("the new version install pkg is ready [%s], waiting for the user's next instruction", newVerInstallPkgPath)
|
||||
return
|
||||
} else if 2 == execInstallPkg { // 执行新版本安装
|
||||
waitSecondForExecInstallPkg = true
|
||||
go execNewVerInstallPkg(newVerInstallPkgPath)
|
||||
}
|
||||
}
|
||||
|
|
@ -398,6 +400,9 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
|||
|
||||
go func() {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
if waitSecondForExecInstallPkg {
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
logging.LogInfof("exited kernel")
|
||||
util.WebSocketServer.Close()
|
||||
os.Exit(util.ExitCodeOk)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue