From d7aea0f5833f2ba770cc59e505c50b6dfbc59b96 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Tue, 10 Oct 2023 13:45:30 +0500 Subject: [PATCH] WorkWellInfoUpdate inceace Timeout to 30 min --- AsbCloudInfrastructure/Services/WellInfoService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AsbCloudInfrastructure/Services/WellInfoService.cs b/AsbCloudInfrastructure/Services/WellInfoService.cs index 7e4cd8ce..0632bafc 100644 --- a/AsbCloudInfrastructure/Services/WellInfoService.cs +++ b/AsbCloudInfrastructure/Services/WellInfoService.cs @@ -27,7 +27,7 @@ public class WellInfoService public WorkWellInfoUpdate() : base("Well statistics update") { - Timeout = TimeSpan.FromMinutes(20); + Timeout = TimeSpan.FromMinutes(30); } protected override async Task Action(string id, IServiceProvider services, Action onProgressCallback, CancellationToken token) @@ -40,8 +40,9 @@ public class WellInfoService var messageHub = services.GetRequiredService>(); var wells = await wellService.GetAllAsync(token); + var activeWells = wells.Where(well => well.IdState == 1); - var wellsIds = wells.Select(w => w.Id); + var wellsIds = activeWells.Select(w => w.Id); var processMapRequests = wellsIds.Select(id => new ProcessMapRequest { IdWell = id }); var processMaps = await processMapRepository.GetProcessMapAsync(processMapRequests, token); @@ -58,9 +59,9 @@ public class WellInfoService var subsystemStat = await subsystemOperationTimeService .GetStatByActiveWells(wellsIds, token); - var count = wells.Count(); + var count = activeWells.Count(); var i = 0d; - WellMapInfo = wells.Select(well => { + WellMapInfo = activeWells.Select(well => { var wellMapInfo = well.Adapt(); wellMapInfo.IdState = well.IdState; onProgressCallback($"Start updating info by well({well.Id}): {well.Caption}", i++ / count);