fix: daemon阻塞从init移入main

This commit is contained in:
Mmx
2021-12-02 22:42:51 +08:00
parent 07d66ced1e
commit d08f2e115c
2 changed files with 6 additions and 8 deletions

View File

@@ -9,9 +9,13 @@ import (
func main() {
defer util.Log.CatchRecover()
if global.Config.Settings.Guardian.Enable {
if global.Flags.RunningDaemon {
//后台挂起模式中
controllers.Guardian(false)
} else if global.Config.Settings.Guardian.Enable {
//进入守护模式流程
controllers.EnterGuardian()
} else if err := controllers.Login(true, false); err != nil {
} else if err := controllers.Login(true, false); err != nil { //单次登录模式
util.Log.Println("运行出错,状态异常")
if global.Config.Settings.DemoMode {
util.Log.Fatalln(err)