elsa-workflows / elsa-workflows/elsa-core

Adding useRetention breaks Asp.net core application

Open
#6,459 1 comment 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

I have added the elsa.useRetention() module to my API. When I try to run it, it starts up but once the retention policy kicks in say after 2 minutes for testing, the application will crash with the following error `The given key was not present in the dictionary`

Just add the example code and import the nuget packages https://docs.elsaworkflows.io/optimize/retention#configuration

elsa.UseRetention(r =>
{
r.SweepInterval = TimeSpan.FromMinutes(30);
r.AddDeletePolicy("Delete all finished workflows", _ => new RetentionWorkflowInstanceFilter()
{
WorkflowStatus = WorkflowStatus.Finished
});
});

4. **Reproduction Rate**: Indicate how often the bug occurs when following these steps (e.g., "every time", "intermittently: about 50% of the time").

every time

## Environment
Elsa 3.3.4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.