Commit e1054225 authored by alexstocks's avatar alexstocks

use log.Exit instead of log.Close

parent 7dd2a440
......@@ -43,7 +43,6 @@ var (
func main() {
initConf()
defer log.Close()
initProfiling()
......@@ -123,13 +122,15 @@ func initSignal() {
// reload()
default:
go time.AfterFunc(conf.failFastTimeout, func() {
log.Warn("app exit now by force...")
os.Exit(1)
// log.Warn("app exit now by force...")
// os.Exit(1)
log.Exit("app exit now by force...")
})
// 要么survialTimeout时间内执行完毕下面的逻辑然后程序退出,要么执行上面的超时函数程序强行退出
uninitClient()
fmt.Println("app exit now...")
// fmt.Println("app exit now...")
log.Exit("app exit now...")
return
}
}
......
......@@ -48,7 +48,6 @@ func main() {
// }
initConf()
defer log.Close()
initProfiling()
......@@ -160,13 +159,15 @@ func initSignal() {
// reload()
default:
go time.AfterFunc(conf.failFastTimeout, func() {
log.Warn("app exit now by force...")
os.Exit(1)
// log.Warn("app exit now by force...")
// os.Exit(1)
log.Exit("app exit now by force...")
})
// 要么survialTimeout时间内执行完毕下面的逻辑然后程序退出,要么执行上面的超时函数程序强行退出
uninitServer()
fmt.Println("app exit now...")
// fmt.Println("app exit now...")
log.Exit("app exit now...")
return
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment