diff --git a/AsbCloudApp/Services/IDataSaubStatService.cs b/AsbCloudApp/Services/IDataSaubStatService.cs index 0ac51f4d..38e9dece 100644 --- a/AsbCloudApp/Services/IDataSaubStatService.cs +++ b/AsbCloudApp/Services/IDataSaubStatService.cs @@ -15,7 +15,10 @@ namespace AsbCloudApp.Services /// /// Создание записей таблицы DataSaubStat /// - /// Временной интервал, за который будет рассчитываться статистика DataSaubStat + /// + /// Количество дней, которые необходимо вычесть из текущей даты для формирования начальной даты + /// сбора данных по телеметрии + /// /// /// /// diff --git a/AsbCloudInfrastructure/Background/PeriodicWorks/WorkDataSaubStat.cs b/AsbCloudInfrastructure/Background/PeriodicWorks/WorkDataSaubStat.cs index 7cef92d4..6a2f92de 100644 --- a/AsbCloudInfrastructure/Background/PeriodicWorks/WorkDataSaubStat.cs +++ b/AsbCloudInfrastructure/Background/PeriodicWorks/WorkDataSaubStat.cs @@ -29,7 +29,7 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks protected override async Task Action(string id, IServiceProvider services, Action onProgressCallback, CancellationToken token) { - var dataSaubStatService = services.GetService(); + var dataSaubStatService = services.GetRequiredService(); if (dataSaubStatService != null ) await dataSaubStatService.CreateStatAsync(Gap, onProgressCallback, token); diff --git a/AsbCloudInfrastructure/Services/DataSaubStatService.cs b/AsbCloudInfrastructure/Services/DataSaubStatService.cs index 6f3d48ea..509615a2 100644 --- a/AsbCloudInfrastructure/Services/DataSaubStatService.cs +++ b/AsbCloudInfrastructure/Services/DataSaubStatService.cs @@ -52,7 +52,7 @@ namespace AsbCloudInfrastructure.Services var lastDate = stats.FirstOrDefault(s => s.IdTelemetry == idTelemetry)?.DateEnd.ToUniversalTime() ?? DateTimeOffset.UnixEpoch; var statsCount = await CreateStatForTelemetryFromDate(idTelemetry, lastDate, token); if(onProgressCallback != null) - onProgressCallback($"Calculate stat for telemetry: {idTelemetry}; from {lastDate}; results count: {statsCount};", 100 * i / idTelemetries.Length); + onProgressCallback($"Calculate stat for telemetry: {idTelemetry}; from {lastDate}; results count: {statsCount};", i * 1d / idTelemetries.Length); } }