forked from ddrilling/AsbCloudServer
WorkWellInfoUpdate inceace Timeout to 30 min
This commit is contained in:
parent
1f79a8f5f7
commit
d7aea0f583
@ -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<string, double?> onProgressCallback, CancellationToken token)
|
||||
@ -40,8 +40,9 @@ public class WellInfoService
|
||||
var messageHub = services.GetRequiredService<IIntegrationEventHandler<UpdateWellInfoEvent>>();
|
||||
|
||||
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<WellMapInfoWithComanies>();
|
||||
wellMapInfo.IdState = well.IdState;
|
||||
onProgressCallback($"Start updating info by well({well.Id}): {well.Caption}", i++ / count);
|
||||
|
Loading…
Reference in New Issue
Block a user