feat: 重构守护入口逻辑

This commit is contained in:
Mmx
2021-09-19 20:54:23 +08:00
parent b148eea874
commit 334f5bbcf0
4 changed files with 12 additions and 17 deletions

View File

@@ -21,7 +21,6 @@ func Guardian(output bool) {
os.Exit(1)
}
global.Status.Output = output
time.Sleep(time.Duration(global.Config.Settings.Guardian) * time.Second)
go func() {
defer func() {
_ = recover()
@@ -37,6 +36,7 @@ func Guardian(output bool) {
c <- false
}()
<-c
time.Sleep(time.Duration(global.Config.Settings.Guardian) * time.Second)
}
}