You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2022. It is now read-only.
We've recently updated most of our email dispatch calls to use celery tasks (asynchronously)- #1341.
But, some of our dispatch email use cases require special handling upon email failure, which Celery does not surface (regardless of if we call asynchronously or synchronously through Celery).
Because Celery does not surface exceptions outside of a task, we currently don't use celery for these use cases, and instead call our dispatch logic directly. We'd like to be able to use Celery for all email dispatch calls.
Problem:
We've recently updated most of our email dispatch calls to use celery tasks (asynchronously)- #1341.
But, some of our dispatch email use cases require special handling upon email failure, which Celery does not surface (regardless of if we call asynchronously or synchronously through Celery).
Because Celery does not surface exceptions outside of a task, we currently don't use celery for these use cases, and instead call our dispatch logic directly. We'd like to be able to use Celery for all email dispatch calls.
Solution:
Celery offers an
on_failurebinding - https://docs.celeryq.dev/en/stable/userguide/tasks.html#on_failure, where we pass in a function to be executed upon failure / exception.The specific use cases where we need to specify on_failure binding: