Fix django-cron jobs - #286
Merged
jsnshrmn merged 1 commit intoNov 9, 2023
Merged
Conversation
Added the retry_after_failure_mins in the schedule constructor
jsnshrmn
approved these changes
Nov 9, 2023
Member
There was a problem hiding this comment.
Okay, I actually tested cron failures this time. I did the following:
- set backup script to exit with status 1
- ran the backup cron every two seconds
watch docker-compose exec externallinks python manage.py runcrons 'extlinks.common.cron.BackupCron'- watched the log fill up with failed backup jobs on master
- watched the job get skipped until the failutre interval (which I shortened for this test) in your patch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added the retry_after_failure_mins in the schedule constructor.
Rationale
The crons will retry more frequently after failures, which can cause a server overload.
Phabricator Ticket
T350295
How Has This Been Tested?
Screenshots of your changes (if appropriate):
Types of changes
What types of changes does your code introduce? Add an
xin all the boxes that apply: