Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Elsa Retention - Job scheduling is not determined by the SweepInterval property configuration. #6251

Closed
jayachandra21 opened this issue Dec 30, 2024 · 1 comment · Fixed by #6259
Assignees
Labels
bug Something isn't working

Comments

@jayachandra21
Copy link

jayachandra21 commented Dec 30, 2024

Description

The Elsa Retention Module - job has not been scheduled according to the SweepInterval property configuration.

Steps to Reproduce

  1. Detailed Steps:
    Configured the SweepInterval property as below:
elsa.UseRetention(r =>
{
    r.SweepInterval = TimeSpan.FromHours(5);
    r.AddDeletePolicy("Delete all finished workflows", sp =>
        {
            RetentionWorkflowInstanceFilter filter = new()
            {
                WorkflowStatus = WorkflowStatus.Finished
            };
            return filter;
        });
});
  1. Run the Workflow.

  2. Retention should be scheduled according to SweepInterval configured for every 5 hours. But it is happening every 1 minute.

  3. Attachments:
    Attached the sample project to use for the reproduce this issue.
    Elsa330RC5.zip

  4. Reproduction Rate: Every time

  5. Video/Screenshots:
    Last Job scheduled is at 30/12/2024 12:15:44PM UTC format.
    image

The next sweep interval triggered is at 30/12/2024 12:17:48PM
image

Expected Behavior

SweepInterval should be scheduled the job every 5 hours as configured below
r.SweepInterval = TimeSpan.FromHours(5);

Actual Behavior

SweepInterval scheduled a job every minute.

Environment

  • Elsa Package Version: Elsa 3.3.3 RC4 , Elsa 3.3.3 RC5
  • Operating System: Windows
  • Browser and Version: Chrome

Troubleshooting Attempts

  1. Tried configure the SweepInterval as a minute.
  2. Tried configure the SweepInterval as a hours.

Additional Context

Whatever the configuration made SweepInterval, but the retention SweepInterval scheduled a job for a minute.

Related Issues

#6194

@jayachandra21 jayachandra21 added the bug Something isn't working label Dec 30, 2024
@sfmskywalker sfmskywalker self-assigned this Jan 1, 2025
@sfmskywalker sfmskywalker moved this to Triage in ELSA 3 Jan 1, 2025
@sfmskywalker sfmskywalker linked a pull request Jan 2, 2025 that will close this issue
@github-project-automation github-project-automation bot moved this from Triage to Done in ELSA 3 Jan 2, 2025
@jayachandra21
Copy link
Author

hello @sfmskywalker,
I attempted to perform retention by defining the run interval for cleanup using the SweepInterval property, as shown below. My understanding is that all finished workflow instances should be deleted at the defined run interval (in this case, every 2 minutes).

However, the instances are not being deleted. Please let me know if my understanding is correct. I have also attached a project with reproduction steps for reference.

I am using Elsa 3.3.0 RC6 and Studio 3.3.0 RC5.

elsa.UseRetention(r =>
{
    r.SweepInterval = TimeSpan.FromMinutes(2);
    r.AddDeletePolicy("Delete all finished workflows", sp =>
        {
            RetentionWorkflowInstanceFilter filter = new()
            {
                //TimestampFilters = new List<TimestampFilter>(),
                WorkflowStatus = WorkflowStatus.Finished
            };
            return filter;
        });
});

Elsa330RC6.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants