forked from ddrilling/AsbCloudServer
CS2-88: Fixed analyze start date calculation
This commit is contained in:
parent
130feacdd5
commit
0132407dd8
@ -323,13 +323,15 @@ namespace AsbCloudInfrastructure.Services
|
||||
.DefaultIfEmpty()
|
||||
.Last();
|
||||
|
||||
var lastAnalysisUnixDate = lastAnalysisInDb?.UnixDate ?? 0;
|
||||
var lastAnalysisUnixDate = lastAnalysisInDb?.UnixDate ?? default;
|
||||
|
||||
var analyzeStartDate = DateTimeOffset.FromUnixTimeSeconds(lastAnalysisUnixDate);
|
||||
var analyzeStartDate = lastAnalysisUnixDate == default
|
||||
? DateTimeOffset.MinValue
|
||||
: DateTimeOffset.FromUnixTimeSeconds(lastAnalysisUnixDate);
|
||||
|
||||
var firstDataSaub = (from ds in db.TelemetryDataSaub
|
||||
where ds.IdTelemetry == idTelemetry &&
|
||||
ds.Date > analyzeStartDate
|
||||
ds.Date >= analyzeStartDate
|
||||
select ds).FirstOrDefault();
|
||||
|
||||
var firstSaubUtcTime = firstDataSaub.Date.ToUniversalTime();
|
||||
|
Loading…
Reference in New Issue
Block a user