2024-02-08 17:33:38 +05:00
|
|
|
|
using AsbCloudApp.Services;
|
2024-01-29 11:51:09 +05:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
namespace AsbCloudInfrastructure.Background.PeriodicWorks;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-10-08 11:23:25 +05:00
|
|
|
|
/// задача по добавлению данных в таблицу t_data_saub_stat, которая используется для построения РТК-отчета
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// </summary>
|
|
|
|
|
internal class WorkDataSaubStat : Work
|
2024-01-29 11:51:09 +05:00
|
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
|
private int Gap = 60;
|
2024-01-31 15:20:14 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
public WorkDataSaubStat() : base("Generate DataSaubStat entries and save them into Db")
|
|
|
|
|
{
|
|
|
|
|
Timeout = TimeSpan.FromMinutes(10);
|
|
|
|
|
}
|
2024-01-29 11:51:09 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
protected override async Task Action(string id, IServiceProvider services, Action<string, double?> onProgressCallback, CancellationToken token)
|
|
|
|
|
{
|
|
|
|
|
var dataSaubStatService = services.GetRequiredService<IDataSaubStatService>();
|
2024-02-05 10:47:00 +05:00
|
|
|
|
|
2024-10-08 11:23:25 +05:00
|
|
|
|
if (dataSaubStatService != null)
|
2024-08-19 10:01:07 +05:00
|
|
|
|
await dataSaubStatService.CreateStatAsync(Gap, onProgressCallback, token);
|
2024-02-01 13:44:27 +05:00
|
|
|
|
|
2024-10-08 11:23:25 +05:00
|
|
|
|
}
|
2024-01-29 11:51:09 +05:00
|
|
|
|
}
|