From 9ab3a57b08c40d92c9a91ee21ea3287167c3c229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sun, 9 Jul 2023 09:33:53 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E7=94=9F=E6=88=90=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E6=89=8D=E5=90=AF=E7=94=A8=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Program.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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限制速率