From cbfce9eefcffac8340b2e0dd0a504588b8280bc3 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 5 Aug 2024 15:57:33 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=80=D0=B5=D0=B2=D1=8C=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Services/IDataSaubStatService.cs | 5 ++++- .../Background/PeriodicWorks/WorkDataSaubStat.cs | 2 +- AsbCloudInfrastructure/Services/DataSaubStatService.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) 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); } }