Cancel an already executing task with Celery?

revoke cancels the task execution. If a task is revoked, the workers ignore the task and do not execute it. If you don’t use persistent revokes your task can be executed after worker’s restart. https://docs.celeryq.dev/en/stable/userguide/workers.html#worker-persistent-revokes revoke has an terminate option which is False by default. If you need to kill the executing task you need … Read more

Retrieve list of tasks in a queue in Celery

EDIT: See other answers for getting a list of tasks in the queue. You should look here: Celery Guide – Inspecting Workers Basically this: my_app = Celery(…) # Inspect all nodes. i = my_app.control.inspect() # Show the items that have an ETA or are scheduled for later processing i.scheduled() # Show tasks that are currently … Read more