Browse Source

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

Liang Ding 2 năm trước cách đây
mục cha
commit
8c7fce8cf2
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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()))