celery / django-celery-results

Celery result back end with django
Other
668 stars 206 forks source link

`backend_cleanup` fails when TaskResult is referenced in a model #383

Closed magicbrothers closed 1 year ago

magicbrothers commented 1 year ago

Assuming a model to connect a User and a TaskResult is created like described here: https://github.com/celery/django-celery-results/issues/46#issuecomment-366139784

Due to delete_expired using raw_delete, which apparently doesn't do cascade deletion, models like ExtraTaskInfo aren't deleted and instead an error is raised: update or delete on table "django_celery_results_taskresult" violates foreign key constraint.

For a full error log and example in a real application see this AlekSIS issue.

hansegucker commented 1 year ago

https://github.com/celery/django-celery-results/pull/235