diff --git a/apihost/Tnb.API.Entry/Configurations/App.json b/apihost/Tnb.API.Entry/Configurations/App.json index 88325a5f..2610456e 100644 --- a/apihost/Tnb.API.Entry/Configurations/App.json +++ b/apihost/Tnb.API.Entry/Configurations/App.json @@ -187,5 +187,6 @@ "DoMainPc": "http://localhost:3000", // 前端PC外网能访问的地址(域名), 回调的时候拼接接口地址用 "DoMainApp": "http://localhost:8081", // 前端App外网能访问的地址(域名), 回调的时候拼接接口地址用 "AppPushUrl": "https://8e84eea8-6922-4033-8e86-67ad7442e692.bspapp.com/unipush" - } + }, + "IsStartTimeJob": true //是否开启定时任务 } \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/Startup.cs b/apihost/Tnb.API.Entry/Startup.cs index ea1f916f..da09f6a4 100644 --- a/apihost/Tnb.API.Entry/Startup.cs +++ b/apihost/Tnb.API.Entry/Startup.cs @@ -109,6 +109,8 @@ public class Startup : AppStartup SnowflakeIdHelper.InitYitIdWorker(); - serviceProvider.GetRequiredService().StartTimerJob(); + bool isStartTimeJob = App.GetConfig("IsStartTimeJob"); + if(isStartTimeJob) + serviceProvider.GetRequiredService().StartTimerJob(); } } \ No newline at end of file