Skip to content

Fix django-cron jobs - #286

Merged
jsnshrmn merged 1 commit into
WikipediaLibrary:masterfrom
suecarmol:suecarmol/T350295-fix-cron-retry
Nov 9, 2023
Merged

Fix django-cron jobs#286
jsnshrmn merged 1 commit into
WikipediaLibrary:masterfrom
suecarmol:suecarmol/T350295-fix-cron-retry

Conversation

@suecarmol

Copy link
Copy Markdown
Contributor

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 x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Added the retry_after_failure_mins in the schedule constructor

@jsnshrmn jsnshrmn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@jsnshrmn
jsnshrmn merged commit e436adc into WikipediaLibrary:master Nov 9, 2023
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.

2 participants