[後台] 修改排程開啓weather api 排程

This commit is contained in:
dev02 2023-06-06 16:50:18 +08:00
parent 85747ad5cb
commit e9649bd7f1

View File

@ -142,12 +142,12 @@ namespace BackendWorkerService
);
#endregion
//#region 定時取得氣象API
//services.AddSingleton<Quartz.Jobs.WeatherAPIJob>();
//services.AddSingleton(
//new JobSchedule(jobType: typeof(Quartz.Jobs.WeatherAPIJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:WeatherAPIJob"))
//);
//#endregion
#region API
services.AddSingleton<Quartz.Jobs.WeatherAPIJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(Quartz.Jobs.WeatherAPIJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:WeatherAPIJob"))
);
#endregion
}).ConfigureLogging((hostContext, logFactory) => {
IConfiguration configuration = hostContext.Configuration;