DD.WellWorkover.Cloud/AsbCloudInfrastructure/Background/PeriodicWorks/WorkDataSaubStatDrillingQuality.cs

31 lines
1.1 KiB
C#

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