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

Event table purger #16

Merged
merged 7 commits into from
Jul 25, 2023
Merged

Event table purger #16

merged 7 commits into from
Jul 25, 2023

Conversation

viktorshevchenko210
Copy link

Describe the change
Implemented Event table purger

Describe your implementation or design
Implemented EventsPurger in a similar way to WorkflowPurger.

Tests
Yes

Breaking change
No

Additional context
We had 16 million rows and it broke our PROD.

.Where(x => x.EventTime < olderThanUtc &&
x.IsProcessed == true)
.Take(Options.BatchSize)
.ExecuteDeleteAsync(cancellationToken);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need db.SaveChangesAsync here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


await WorkflowPurger.PurgeWorkflows(WorkflowStatus.Complete, DateTime.UtcNow);
await EventsPurger.PurgeEvents(DateTime.UtcNow);
await EventsPurger.PurgeEvents(DateTime.UtcNow);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why purge two times?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

@SergiiKram SergiiKram merged commit 9aa6cc9 into SergiiKram:idempotent-workflow-start Jul 25, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants