From e8641fa682f58b70ac5c38be62352993a9bef0a3 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 2 Feb 2023 19:47:47 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:art:=20=E9=80=80=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E6=B8=85=E7=90=86=E6=97=A7=E7=89=88=E5=9D=97=E6=95=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/conf.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index a1389eca5..c55415e1a 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -708,6 +708,7 @@ func clearWorkspaceTemp() { os.RemoveAll(filepath.Join(util.TempDir, "import")) os.RemoveAll(filepath.Join(util.TempDir, "repo")) os.RemoveAll(filepath.Join(util.TempDir, "os")) + os.RemoveAll(filepath.Join(util.TempDir, "blocktree.msgpack")) // v2.7.2 前旧版的块数数据 // 退出时自动删除超过 7 天的安装包 https://github.com/siyuan-note/siyuan/issues/6128 install := filepath.Join(util.TempDir, "install") From 88c478dc72878d83588b7def32f2358c465b1538 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 2 Feb 2023 19:50:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E6=A1=8C?= =?UTF-8?q?=E9=9D=A2=E7=AB=AF=E7=9B=91=E6=8E=A7=E5=89=8D=E7=AB=AF=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=BF=9B=E7=A8=8B=E9=80=80=E5=87=BA=E9=92=A9=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/process.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/model/process.go b/kernel/model/process.go index 983b742a3..1336ea897 100644 --- a/kernel/model/process.go +++ b/kernel/model/process.go @@ -37,7 +37,10 @@ func HandleSignal() { Close(false, 1) } -var firstRunHookDesktopUIProcJob = true +var ( + firstRunHookDesktopUIProcJob = true + noUIProcCount int +) func HookDesktopUIProcJob() { if util.ContainerStd != util.Container || "dev" == util.Mode { @@ -56,7 +59,6 @@ func HookDesktopUIProcJob() { } uiProcNames := []string{"siyuan", "electron"} - existUIProc := false util.UIProcessIDs.Range(func(uiProcIDArg, _ interface{}) bool { uiProcID, err := strconv.Atoi(uiProcIDArg.(string)) if nil != err { @@ -77,14 +79,14 @@ func HookDesktopUIProcJob() { procName := strings.ToLower(proc.Executable()) for _, name := range uiProcNames { if strings.Contains(procName, name) { - existUIProc = true + noUIProcCount++ return false } } return true }) - if !existUIProc { + if 1 < noUIProcCount { logging.LogInfof("no active UI proc, exit kernel process now") Close(false, 1) } From 4c6b61cc371c8935da75dba173e18a4743df152a Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 2 Feb 2023 19:55:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E6=A1=8C?= =?UTF-8?q?=E9=9D=A2=E7=AB=AF=E7=9B=91=E6=8E=A7=E5=89=8D=E7=AB=AF=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=BF=9B=E7=A8=8B=E9=80=80=E5=87=BA=E9=92=A9=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/process.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/model/process.go b/kernel/model/process.go index 1336ea897..3d68cb363 100644 --- a/kernel/model/process.go +++ b/kernel/model/process.go @@ -86,8 +86,11 @@ func HookDesktopUIProcJob() { return true }) - if 1 < noUIProcCount { - logging.LogInfof("no active UI proc, exit kernel process now") - Close(false, 1) + if 0 < noUIProcCount { + logging.LogInfof("no active UI proc count [%d]", noUIProcCount) + if 1 < noUIProcCount { + logging.LogInfof("confirmed no active UI proc, exit kernel process now") + Close(false, 1) + } } }