code refactor

This commit is contained in:
UlricQin 2020-07-03 12:38:20 +08:00
parent d0a00236ba
commit dbd81eed2b
2 changed files with 4 additions and 1 deletions

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