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

40 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using AsbCloudApp.Data;
using AsbCloudApp.Data.DetectedOperation;
using AsbCloudApp.Data.SAUB;
using AsbCloudApp.Repositories;
using AsbCloudApp.Requests;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using AsbCloudInfrastructure.Services.DetectOperations;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudInfrastructure.Background.PeriodicWorks
{
/// <summary>
/// задача по добавлению данных в таблицу DataSaubStat, которая используется для построения РТК-отчета
/// </summary>
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<string, double?> onProgressCallback, CancellationToken token)
{
var dataSaubStatService = services.GetService<IDataSaubStatService>();
if (dataSaubStatService != null )
await dataSaubStatService.CreateStatAsync(Gap, onProgressCallback, token);
}
}
}