feat:支持自动退出多余守护进程

This commit is contained in:
Mmx
2021-07-17 16:18:22 +08:00
parent c331805539
commit f3b8216b83
2 changed files with 34 additions and 0 deletions

View File

@@ -9,8 +9,17 @@ import (
)
func Guardian(output bool) {
global.Status.Output = output
if e := Daemon.MarkDaemon(); e != nil {
util.Log.Fatalln(e)
}
var c = make(chan bool)
for {
if !Daemon.CheckDaemon() {
os.Exit(1)
}
global.Status.Output = output
time.Sleep(time.Duration(global.Config.Settings.Guardian) * time.Second)
go func() {