[Answer]-Periodic task using celery to delete a queryset result

1👍

As @schillingt mentioned most of the time, we forget to (re)start worker process for the periodic task.

This happens because we have a beat scheduler which schedules the task and worker which executes the task.

celery -A my_task beat  # schedule tasks
celery worker -A my_task -l info  # consume tasks

A much better solution is to have a worker which schedules task & executes. You can do that using

celery worker -A my_task -l info --beat  # schedule & consume tasks

This schedules the periodic task and consumes it.

Leave a comment