-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
3 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/modules/Elsa.Retention/CleanupStrategies/DeleteWorkflowInstanceStrategy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Elsa.Retention.Contracts; | ||
using Elsa.Workflows.Management; | ||
using Elsa.Workflows.Management.Entities; | ||
using Elsa.Workflows.Management.Filters; | ||
|
||
namespace Elsa.Retention.CleanupStrategies; | ||
|
||
/// <summary> | ||
/// Deletes the workflow instance. | ||
/// </summary> | ||
public class DeleteWorkflowInstanceStrategy(IWorkflowInstanceStore store) : IDeletionCleanupStrategy<WorkflowInstance> | ||
{ | ||
public async Task Cleanup(ICollection<WorkflowInstance> collection) | ||
{ | ||
await store.DeleteAsync(new WorkflowInstanceFilter | ||
{ | ||
Ids = collection.Select(x => x.Id).ToArray() | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters