diff --git a/BackendWorkerService/Program.cs b/BackendWorkerService/Program.cs index e293df7..83bb120 100644 --- a/BackendWorkerService/Program.cs +++ b/BackendWorkerService/Program.cs @@ -122,10 +122,10 @@ namespace BackendWorkerService //#endregion //#region 停車場管理(設定每 5秒 執行一次) - //services.AddSingleton(); - //services.AddSingleton( - //new JobSchedule(jobType: typeof(ParkingJob), cronExpression: configuration.GetValue("BackgroundServiceCron:ParkingJob")) - //); + services.AddSingleton(); + services.AddSingleton( + new JobSchedule(jobType: typeof(ParkingJob), cronExpression: configuration.GetValue("BackgroundServiceCron:ParkingJob")) + ); //#endregion //#region 電錶歸檔(設定每 小時 執行一次) diff --git a/BackendWorkerService/Quartz/Jobs/ParkingJob.cs b/BackendWorkerService/Quartz/Jobs/ParkingJob.cs index 4391508..61251cf 100644 --- a/BackendWorkerService/Quartz/Jobs/ParkingJob.cs +++ b/BackendWorkerService/Quartz/Jobs/ParkingJob.cs @@ -95,7 +95,7 @@ namespace BackendWorkerService.Quartz.Jobs { var tagName = selectedMapping.system_value; var apiFormat = @"{0}obix/config/Arena/{1}/{2}/{3}/{4}/{5}/CV/set"; - + var tagNameSplit = tagName.Split("_"); var parames = new List(); @@ -104,14 +104,14 @@ namespace BackendWorkerService.Quartz.Jobs { if (i != tagNameSplit.Length - 1) { - parames.Add(tagNameSplit[i]); + parames.Add(tagNameSplit[i]); // tag 4畾 } else { - parames.Add(tagName); + parames.Add(tagName); // 蝚砌畾 摰 tag } } - + logger.LogError(@$"ParkingJob頠游拚頠雿{apiFormat}"); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(string.Format(apiFormat, parames.ToArray())); request.Method = "POST"; request.Headers.Add("Authorization", "Basic " + encoded);