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);