celery / django-celery-results

Celery result back end with django
Other
684 stars 203 forks source link

delete_expired method fails for large queryset. #430

Open pyarun opened 4 months ago

pyarun commented 4 months ago

We process and save results for around 1M task everyday. I see celery.backend_cleanup: 0 4 * * * (m/h/dM/MY/d) UTC in Periodic tasks and it runs everyday. but records are not deleted.

When i ran TaskResult.objects.delete_expired(24*3600) from django shell, shell was killed.

Should we refactor delete_expired to delete objects in chunks?