bgService 開啟停車場 API 讀取服務
This commit is contained in:
parent
919130d94f
commit
a368396189
@ -122,10 +122,10 @@ namespace BackendWorkerService
|
|||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region 停車場管理(設定每 5秒 執行一次)
|
//#region 停車場管理(設定每 5秒 執行一次)
|
||||||
//services.AddSingleton<ParkingJob>();
|
services.AddSingleton<ParkingJob>();
|
||||||
//services.AddSingleton(
|
services.AddSingleton(
|
||||||
//new JobSchedule(jobType: typeof(ParkingJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:ParkingJob"))
|
new JobSchedule(jobType: typeof(ParkingJob), cronExpression: configuration.GetValue<string>("BackgroundServiceCron:ParkingJob"))
|
||||||
//);
|
);
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region 電錶歸檔(設定每 小時 執行一次)
|
//#region 電錶歸檔(設定每 小時 執行一次)
|
||||||
|
@ -104,14 +104,14 @@ namespace BackendWorkerService.Quartz.Jobs
|
|||||||
{
|
{
|
||||||
if (i != tagNameSplit.Length - 1)
|
if (i != tagNameSplit.Length - 1)
|
||||||
{
|
{
|
||||||
parames.Add(tagNameSplit[i]);
|
parames.Add(tagNameSplit[i]); // tag 前 4段
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parames.Add(tagName);
|
parames.Add(tagName); // 第五段 完整 tag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
logger.LogError(@$"【ParkingJob】【停車場剩餘車位】{apiFormat}");
|
||||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(string.Format(apiFormat, parames.ToArray()));
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(string.Format(apiFormat, parames.ToArray()));
|
||||||
request.Method = "POST";
|
request.Method = "POST";
|
||||||
request.Headers.Add("Authorization", "Basic " + encoded);
|
request.Headers.Add("Authorization", "Basic " + encoded);
|
||||||
|
Loading…
Reference in New Issue
Block a user