|
@@ -370,6 +370,34 @@ namespace Ropin.Environmentally.WebScada.Work
|
|
|
});
|
|
|
#endregion
|
|
|
|
|
|
+ #region //AI报警同步
|
|
|
+ Task.Run(async () =>
|
|
|
+ {
|
|
|
+ while (true)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ using (HttpClient httpClient = httpClientFactory.CreateClient())
|
|
|
+ {
|
|
|
+ var httpRequestMessage = new HttpRequestMessage
|
|
|
+ {
|
|
|
+ Method = HttpMethod.Get,
|
|
|
+ RequestUri = new Uri(_aPIUrlData.PublicPushMessageAPI)
|
|
|
+ };
|
|
|
+ var response = await httpClient.SendAsync(httpRequestMessage);
|
|
|
+ string responseResult = await response.Content.ReadAsStringAsync();
|
|
|
+ log.Info($"AI报警数据同步接口返回【{responseResult}】");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ _logger.LogInformation("AI报警同步"+ex.Message);
|
|
|
+ }
|
|
|
+ await Task.Delay(60000);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region
|
|
|
//Timer t = new Timer(async (o) => {
|
|
|
// if (await _redisService.ExistsAsync("fanyibox_devStore"))
|