浏览代码

:bug: macOS 端报错 `数据库被锁定` Fix https://github.com/siyuan-note/siyuan/issues/6492

Liang Ding 2 年之前
父节点
当前提交
8c7fce8cf2
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      kernel/server/port.go

+ 4 - 0
kernel/server/port.go

@@ -50,8 +50,12 @@ func killRunningKernel() {
 		return
 	}
 
+	currentPid := os.Getpid()
 	killed := false
 	for _, process := range processes {
+		if process.Pid() == currentPid {
+			continue
+		}
 		procName := strings.ToLower(process.Executable())
 		if strings.Contains(procName, "siyuan-kernel") {
 			kill(fmt.Sprintf("%d", process.Pid()))