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.
19 lines
475 B
C#
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);
|
|
}
|
|
} |