How to schedule periodic delete of celery backend in Flask?

34 Views Asked by At

How do I schedule periodic delete of celery backend data and flower logs such as all the data before 48 hours will be deleted. I am using a MongoDB backend to store the celery backend data.

1

There are 1 best solutions below

0
Lemon Reddy On

Celery doesn't support it as of now. You can either change the backend to one of the supported ones or you can write a custom script/celery task to delete the results manually and run it with cron/celery beat respectively. If you are already using Redis somewhere in your stack, use it as result backend too which is very common.