bgService: 開啟停車場服務更新功能

This commit is contained in:
jiahao 2023-09-27 16:14:58 +08:00
parent a539c8148c
commit 9e5bdb2ea5
2 changed files with 5 additions and 5 deletions

View File

@ -122,10 +122,10 @@ namespace BackendWorkerService
//#endregion
//#region 停車場管理(設定每 5秒 執行一次)
//services.AddSingleton<ParkingJob>();
//services.AddSingleton(
//new JobSchedule(jobType: typeof(ParkingJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:ParkingJob"))
//);
services.AddSingleton<ParkingJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(ParkingJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:ParkingJob"))
);
//#endregion
//#region 電錶歸檔(設定每 小時 執行一次)

View File

@ -82,7 +82,7 @@ namespace BackendWorkerService.Quartz.Jobs
var spaceResponseResult = JsonConvert.DeserializeObject<SpaceResponse>(spaceResponseContent);
//取得停車場車位對應表
var sqlSapceMapping = $@"SELECT * FROM variable WHERE deleted = 0 AND system_type = 'parkingSapceMapping'";
var sqlSapceMapping = $@" SELECT * FROM variable WHERE deleted = 0 AND system_type = 'parkingSapceMapping'";
var parkingSapceMapping = await backgroundServiceRepository.GetAllAsync<VariableInfo>(sqlSapceMapping);
if (spaceResponseResult != null && spaceResponseResult.Code == "20000")