Правки по ревью

This commit is contained in:
Olga Nemt 2024-08-05 15:57:33 +05:00
parent 1aeb9599d1
commit cbfce9eefc
3 changed files with 6 additions and 3 deletions

View File

@ -15,7 +15,10 @@ namespace AsbCloudApp.Services
/// <summary>
/// Создание записей таблицы DataSaubStat
/// </summary>
/// <param name="gap">Временной интервал, за который будет рассчитываться статистика DataSaubStat</param>
/// <param name="gap">
/// Количество дней, которые необходимо вычесть из текущей даты для формирования начальной даты
/// сбора данных по телеметрии
/// </param>
/// <param name="onProgressCallback"></param>
/// <param name="token"></param>
/// <returns></returns>

View File

@ -29,7 +29,7 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
protected override async Task Action(string id, IServiceProvider services, Action<string, double?> onProgressCallback, CancellationToken token)
{
var dataSaubStatService = services.GetService<IDataSaubStatService>();
var dataSaubStatService = services.GetRequiredService<IDataSaubStatService>();
if (dataSaubStatService != null )
await dataSaubStatService.CreateStatAsync(Gap, onProgressCallback, token);

View File

@ -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);
}
}