This commit is contained in:
710leo 2020-07-07 14:12:02 +08:00
commit 5bb48df01d
3 changed files with 8 additions and 1 deletions

View File

@ -97,6 +97,10 @@ func main() {
go worker.PusherStart()
go worker.Zeroize()
if cfg.Logger.Level != "DEBUG" {
gin.SetMode(gin.ReleaseMode)
}
r := gin.New()
routes.Config(r)
http.Start(r, "collector", cfg.Logger.Level)

View File

@ -80,6 +80,10 @@ func main() {
go judge.NodataJudge(cfg.NodataConcurrency)
go report.Init(cfg.Report, "monapi")
if cfg.Logger.Level != "DEBUG" {
gin.SetMode(gin.ReleaseMode)
}
r := gin.New()
routes.Config(r)
go http.Start(r, "judge", cfg.Logger.Level)

View File

@ -25,7 +25,6 @@ func Start(r *gin.Engine, mod string, level string) {
recoveryMid := middleware.Recovery()
if level != "DEBUG" {
gin.SetMode(gin.ReleaseMode)
middleware.DisableConsoleColor()
} else {
srv.WriteTimeout = 120 * time.Second