From 82be8aebe744ff4c6dee76c976da0e6dde65e1e9 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Wed, 7 Jun 2023 09:43:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=AF=E5=90=A6=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apihost/Tnb.API.Entry/Configurations/App.json | 3 ++- apihost/Tnb.API.Entry/Startup.cs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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