Ver código fonte

:art: 改进桌面端退出监控后台任务

Liang Ding 2 anos atrás
pai
commit
6e56393ab9
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      kernel/model/process.go

+ 5 - 0
kernel/model/process.go

@@ -51,8 +51,13 @@ func HookDesktopUIProcJob() {
 		return
 	}
 
+	if 0 < util.CountSessions() {
+		return
+	}
+
 	uiProcNames := []string{"siyuan", "electron"}
 	existUIProc := false
+
 	util.UIProcessIDs.Range(func(uiProcIDArg, _ interface{}) bool {
 		uiProcID, err := strconv.Atoi(uiProcIDArg.(string))
 		if nil != err {