Skip to content

Commit

Permalink
Merge pull request #6208 from Sverre-W/retention-sweep-interval
Browse files Browse the repository at this point in the history
Retention: Add sweep interval to feature configuration
  • Loading branch information
sfmskywalker authored Dec 13, 2024
2 parents 99d48a8 + 7049872 commit 08f7c2b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/Elsa.Retention/Feature/RetentionFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public RetentionFeature(IModule module) : base(module)
/// </summary>
public Action<CleanupOptions> ConfigureCleanupOptions { get; set; } = _ => { };

/// <summary>
/// Defines the run interval of the cleanup job
/// </summary>
public TimeSpan SweepInterval { get; set; } = TimeSpan.FromHours(4);

/// <inheritdoc cref="FeatureBase" />
public override void Apply()
{
Expand All @@ -44,7 +49,7 @@ public override void Apply()
Services.AddScoped<IRelatedEntityCollector, ActivityExecutionRecordCollector>();
Services.AddScoped<IRelatedEntityCollector, WorkflowExecutionLogRecordCollector>();

Services.AddRecurringTask<CleanupRecurringTask>(TimeSpan.FromHours(4));
Services.AddRecurringTask<CleanupRecurringTask>(SweepInterval);

foreach (var policy in this.GetPolicies())
{
Expand Down

0 comments on commit 08f7c2b

Please sign in to comment.