diff --git a/ZR.Admin.WebApi/Program.cs b/ZR.Admin.WebApi/Program.cs index 9fc5ad2..085ee6c 100644 --- a/ZR.Admin.WebApi/Program.cs +++ b/ZR.Admin.WebApi/Program.cs @@ -121,8 +121,11 @@ app.UseAuthorization(); //开启缓存 app.UseResponseCaching(); -//恢复/启动任务 -app.UseAddTaskSchedulers(); +if (builder.Environment.IsProduction()) +{ + //恢复/启动任务 + app.UseAddTaskSchedulers(); +} //使用swagger app.UseSwagger(); //启用客户端IP限制速率