diff --git a/cmd/server/main.go b/cmd/server/main.go index baca30d..cf658c3 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -28,7 +28,10 @@ func main() { }() //钉钉机器人 app.DingBotServer.Run(ctx, *onBot) - //定时任务 - app.Cron.Run(ctx) + //定时任务 - 测试环境不启用 + if configPath != nil && *configPath == "./config/config.yaml" { + app.Cron.Run(ctx) + } + log.Fatal(app.HttpServer.Listen(fmt.Sprintf(":%d", bc.Server.Port))) }