mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🔥 移除 --resident 和 --servePath 内核参数 Fix https://github.com/siyuan-note/siyuan/issues/6389
This commit is contained in:
parent
4559b03488
commit
3bd6c3fb20
6 changed files with 1 additions and 38 deletions
|
|
@ -20,38 +20,10 @@ import (
|
|||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func HookResident() {
|
||||
if util.Resident {
|
||||
return
|
||||
}
|
||||
|
||||
for range time.Tick(time.Second * 30) {
|
||||
if makeSureSessionEmpty() {
|
||||
logging.LogInfof("no active session, exit kernel process now")
|
||||
Close(false, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func makeSureSessionEmpty() bool {
|
||||
count := 0
|
||||
for i := 0; i < 7; i++ {
|
||||
count = util.CountSessions()
|
||||
//logging.LogDebugf("session count [%d]", count)
|
||||
if 0 < count {
|
||||
return false
|
||||
}
|
||||
time.Sleep(time.Second * 1)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func HandleSignal() {
|
||||
c := make(chan os.Signal)
|
||||
signal.Notify(c, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue