Fixed Telemetry analysis start depending on analyze start date

This commit is contained in:
KharchenkoVV 2021-09-29 12:20:19 +05:00
parent c0918652a3
commit b60b84b45c
2 changed files with 32 additions and 29 deletions

View File

@ -35,7 +35,7 @@ namespace AsbCloudInfrastructure.Services
var timeToStartAnalysis = DateTime.Now;
while (false)//(!token.IsCancellationRequested)
while (!token.IsCancellationRequested)
{
if(DateTime.Now > timeToStartAnalysis)
{

View File

@ -242,6 +242,8 @@ namespace AsbCloudInfrastructure.Services
{
var analyzeStartDate = GetAnalyzeStartDate(idTelemetry);
if(analyzeStartDate != default)
{
while (GetDataSaubsToAnalyze(idTelemetry, analyzeStartDate).Any())
{
var dataSaubsToAnalyze = GetDataSaubsToAnalyze(idTelemetry, analyzeStartDate);
@ -283,6 +285,7 @@ namespace AsbCloudInfrastructure.Services
}
}
}
}
public async Task<DatesRangeDto> GetOperationsDateRangeAsync(int idWell,
CancellationToken token = default)
@ -334,7 +337,7 @@ namespace AsbCloudInfrastructure.Services
ds.Date >= analyzeStartDate
select ds).FirstOrDefault();
var firstSaubUtcTime = firstDataSaub.Date.ToUniversalTime();
var firstSaubUtcTime = firstDataSaub?.Date.ToUniversalTime() ?? default;
return firstSaubUtcTime;
}