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

Update Celery config to use UTC time #2080

Merged
merged 9 commits into from
Jan 22, 2024
Merged

Update Celery config to use UTC time #2080

merged 9 commits into from
Jan 22, 2024

Conversation

whabanks
Copy link
Contributor

@whabanks whabanks commented Jan 17, 2024

Summary | Résumé

This PR updates the Celery and Celery beat configs to enable and use UTC time instead of EST / local time.

Testing

Do this off main first, or change the celery timezone config back to America/Toronto temporarily.

  1. Set a distinctive NOTIFICATION_QUEUE_PREFIX in your .env file
  2. Run the app + Celery + beat
  3. Schedule several bulk notifications to yourself in the future, 5 or 10 minutes will do
  4. Shut down Celery + beat
  5. In staging SQS, check the <queue-prefix>-bulk-tasks and <queue-prefix>-periodic-tasks queues and verify that the messages are present

Part 2

  1. Check out this branch or restore the timezone config back to UTC
  2. Run Celery + beat
  3. Receive your scheduled notifications
  4. Observe the the queues being drained of tasks/messages, that were scheduled while Celery was configured to use EST time, without issue when configured to use UTC time.

jzbahrai
jzbahrai previously approved these changes Jan 18, 2024
@jzbahrai jzbahrai dismissed their stale review January 18, 2024 20:30

need to test

@jzbahrai
Copy link
Collaborator

Tested by setting a job in the future, but then changing to this branch - the job completed!

@whabanks whabanks merged commit bc5d81e into main Jan 22, 2024
4 checks passed
@whabanks whabanks deleted the celery-use-utc branch January 22, 2024 20:26
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