elsa-core/src/modules/Elsa.Retention/Tasks/CleanupRecurringTask.cs
Sipke Schoorstra d3d171f59f Refactor retention module to use recurring tasks
Replaced the CleanupHostedService with CleanupRecurringTask for better scheduling and simpler configuration. Converted several classes to use constructor-based dependency injection and streamlined some type assignments. Removed unneeded files and updated existing code to follow more concise conventions. This enhances maintainability and readability.
2024-10-29 08:36:31 +01:00

19 lines
475 B
C#

using Elsa.Common;
using Elsa.Common.RecurringTasks;
using Elsa.Retention.Jobs;
using JetBrains.Annotations;
namespace Elsa.Retention;
/// <summary>
/// Periodically deletes workflow instances and their execution logs.
/// </summary>
[SingleNodeTask]
[UsedImplicitly]
public class CleanupRecurringTask(CleanupJob job) : RecurringTask
{
public override async Task ExecuteAsync(CancellationToken stoppingToken)
{
await job.ExecuteAsync(stoppingToken);
}
}