mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-18 18:10:43 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
7ced94a194
@ -708,6 +708,7 @@ func clearWorkspaceTemp() {
|
|||||||
os.RemoveAll(filepath.Join(util.TempDir, "import"))
|
os.RemoveAll(filepath.Join(util.TempDir, "import"))
|
||||||
os.RemoveAll(filepath.Join(util.TempDir, "repo"))
|
os.RemoveAll(filepath.Join(util.TempDir, "repo"))
|
||||||
os.RemoveAll(filepath.Join(util.TempDir, "os"))
|
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
|
// 退出时自动删除超过 7 天的安装包 https://github.com/siyuan-note/siyuan/issues/6128
|
||||||
install := filepath.Join(util.TempDir, "install")
|
install := filepath.Join(util.TempDir, "install")
|
||||||
|
@ -37,7 +37,10 @@ func HandleSignal() {
|
|||||||
Close(false, 1)
|
Close(false, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
var firstRunHookDesktopUIProcJob = true
|
var (
|
||||||
|
firstRunHookDesktopUIProcJob = true
|
||||||
|
noUIProcCount int
|
||||||
|
)
|
||||||
|
|
||||||
func HookDesktopUIProcJob() {
|
func HookDesktopUIProcJob() {
|
||||||
if util.ContainerStd != util.Container || "dev" == util.Mode {
|
if util.ContainerStd != util.Container || "dev" == util.Mode {
|
||||||
@ -56,7 +59,6 @@ func HookDesktopUIProcJob() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uiProcNames := []string{"siyuan", "electron"}
|
uiProcNames := []string{"siyuan", "electron"}
|
||||||
existUIProc := false
|
|
||||||
util.UIProcessIDs.Range(func(uiProcIDArg, _ interface{}) bool {
|
util.UIProcessIDs.Range(func(uiProcIDArg, _ interface{}) bool {
|
||||||
uiProcID, err := strconv.Atoi(uiProcIDArg.(string))
|
uiProcID, err := strconv.Atoi(uiProcIDArg.(string))
|
||||||
if nil != err {
|
if nil != err {
|
||||||
@ -77,15 +79,18 @@ func HookDesktopUIProcJob() {
|
|||||||
procName := strings.ToLower(proc.Executable())
|
procName := strings.ToLower(proc.Executable())
|
||||||
for _, name := range uiProcNames {
|
for _, name := range uiProcNames {
|
||||||
if strings.Contains(procName, name) {
|
if strings.Contains(procName, name) {
|
||||||
existUIProc = true
|
noUIProcCount++
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
if !existUIProc {
|
if 0 < noUIProcCount {
|
||||||
logging.LogInfof("no active UI proc, exit kernel process now")
|
logging.LogInfof("no active UI proc count [%d]", noUIProcCount)
|
||||||
Close(false, 1)
|
if 1 < noUIProcCount {
|
||||||
|
logging.LogInfof("confirmed no active UI proc, exit kernel process now")
|
||||||
|
Close(false, 1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user