forked from ddrilling/AsbCloudServer
24 lines
749 B
C#
24 lines
749 B
C#
|
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<string, double?> onProgressCallback, CancellationToken token)
|
|||
|
{
|
|||
|
var reportService = services.GetRequiredService<IReportService>();
|
|||
|
await reportService.DeleteAllOldReportsAsync(-30, token);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|