using AsbCloudApp.Services;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Background.PeriodicWorks;
///
/// задача по добавлению данных в таблицу t_data_saub_stat, которая используется для построения РТК-отчета
///
internal class WorkDataSaubStat : Work
{
private int Gap = 60;
public WorkDataSaubStat() : base("Generate DataSaubStat entries and save them into Db")
{
Timeout = TimeSpan.FromMinutes(10);
}
protected override async Task Action(string id, IServiceProvider services, Action onProgressCallback, CancellationToken token)
{
var dataSaubStatService = services.GetRequiredService();
if (dataSaubStatService != null)
await dataSaubStatService.CreateStatAsync(Gap, onProgressCallback, token);
}
}