Open simondrabble opened 6 years ago
same here, I use django-celery-results and sending email results are not written to database.
Put the following in settings.py and django-celery-results should work with one TaskResult per email:
CELERY_EMAIL_TASK_CONFIG = {'ignore_result': False} CELERY_EMAIL_CHUNK_SIZE = 1
It took me a long time to figure this out even though it is mentioned in the README. Perhaps an update there to explicitly call out the django-celery-results package would be helpful?
Issue:
Sending email via django-celery-email, results cannot be tracked, leading to issues with e.g. the following scenario:
Non-django celery email tasks do not exhibit this behaviour.
Config:
Procedure:
Send an email (e.g. via
mail.send_mail(...)
)The email is delivered successfully, i.e. the task completes.
Observed:
Resulting task has an ID but no entry in the database:
Task cannot be waited for, and status is not updated:
Expected:
The task is written to the database, and the status is updated to SUCCESS or FAILURE as appropriate.
Additional Info:
The problem also occurs if the django-celery-email task is run directly:
It does not occur if a non-email task is executed:
Update: added software versions