elsa-workflows / elsa-workflows/elsa-core

Elsa Retention - PageSize Property configuration

Open
#6,795 0 comments 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

## Description
Configured the Retention module with following and I have observed that irrespective of PageSize configuration, all Finished status instances are deleted.

## Steps to Reproduce
To help us identify the issue more quickly, please follow these guidelines:

1. **Detailed Steps**:
Configured the PageSize=5
```
elsa.UseRetention(r =>
{
r.SweepInterval = TimeSpan.FromMinutes(5);

r.ConfigureCleanupOptions = options =>
{
options.PageSize = 5;
};
r.AddDeletePolicy("Delete all finished workflows", sp =>
{
RetentionWorkflowInstanceFilter filter = new()
{
WorkflowStatus = WorkflowStatus.Finished
};
return filter;
});
});
```

Workflow is configured with Cron activity to triggered every 30 seconds.
So, in 5 minutes there are 10 workflow instances which are finished state.
But when retention executes, it deleted the all finished status instaces.

2. **Reproduction Rate**: "every time"

## Expected Behavior
Suppose to delete the instances which are configured in the page size.

## Actual Behavior
Deleting all finished instances.

## Environment
- **Elsa Package Version**: 3.3.5.
- **Operating System**: Windows
- **Browser and Version**: Chrome

## Log Output
info: Elsa.Retention.Jobs.CleanupJob[0]
Cleaned up 10 workflow instances through Delete all finished workflows

## Additional Context
While executing the Retention, Elsa sweeps repeatedly, fetching page after page, until no more deletable workflows instances are found?

## Related Issues
https://github.com/elsa-workflows/elsa-core/issues/6194
https://github.com/elsa-workflows/elsa-core/issues/6251

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.