feat:支持后台模式与网络守护

This commit is contained in:
Mmx
2021-07-11 12:52:56 +08:00
parent e3f668c100
commit 257a9b7034
8 changed files with 192 additions and 86 deletions

View File

@@ -52,13 +52,14 @@ func Sha1(content string) string {
}
func ErrHandler(err error) {
if err != nil {
Log.Println("运行出错,状态异常")
if global.Config.Settings.DemoMode {
Log.Fatalln(err)
}
os.Exit(1)
if !global.Status.Output {
return
}
Log.Println("运行出错,状态异常")
if global.Config.Settings.DemoMode {
Log.Fatalln(err)
}
os.Exit(1)
}
func NetDailEr() func(ctx context.Context, network, address string) (net.Conn, error) {