-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable retries for send_instructor_email_digests()
Enable retries for the `send_instructor_email_digests()` task. We want to take the risk of potentially sending users multiple copies of the same email digest (up to 3 copies since this commit sets `max_retries` to `2`) rather than risking failing to send them any email at all. To that end, configure the `send_instructor_email_digests()` task to use up to 2 Celery retries if the task fails. Use a long delay between retries (hours rather than seconds or minutes) to maximise the chances of the retry succeeding (for example if the failure was caused by a Mailchimp outage then retrying after a long delay maximises the chances of the outage being resolved by the time we retry). Retrying is made slightly subtle by the fact that `send_instructor_email_digests()` processes emails in batches. If just 1 email in a batch of 1000 fails to send then we want to retry just that one email and not send duplicates of the other 999. Fortunately this is easy to achieve by mutating the tasks `h_userids` kwarg when retrying.
- Loading branch information
Showing
2 changed files
with
95 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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