using AsbCloudApp.Services; using Microsoft.Extensions.DependencyInjection; using System; using System.Threading; using System.Threading.Tasks; namespace AsbCloudInfrastructure.Background { public class WorkToDeleteOldReports : Work { public WorkToDeleteOldReports() : base("work to delete reports older than 30 days") { Timeout = TimeSpan.FromMinutes(10); } protected override async Task Action(string id, IServiceProvider services, Action onProgressCallback, CancellationToken token) { var reportService = services.GetRequiredService(); await reportService.DeleteAllOldReportsAsync(-30, token); } } }