-
Notifications
You must be signed in to change notification settings - Fork 429
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
fix(task-processor): implement grace period for deleting old recurring task #3169
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Preview |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3169 +/- ##
==========================================
- Coverage 96.11% 95.99% -0.12%
==========================================
Files 1059 1062 +3
Lines 32036 32265 +229
==========================================
+ Hits 30791 30973 +182
- Misses 1245 1292 +47 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the issue be solved if we could check the created_at
on the task_processor_recurringtask
and if the task is sufficiently old it could be deleted?
Yeah, good shout! I have added the code to use a grace period |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor nit but the rest looks good
# make the task old | ||
RecurringTask.objects.update( | ||
created_at=timezone.now() - UNREGISTERED_RECURRING_TASK_GRACE_PERIOD | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: If we can use freezegun
that would be better.
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
Fixes #2551 by implementing a grace period to not remove new tasks during deployment
How did you test this code?
Updates/Adds unit test