1

I have a long running celery task. I want to terminate/stop/revoke that task if user hits /cancel route. I used multiple ways of doing this, but none of them worked. I am using RabbitMQ as a message broker.

I have defined a view called "cancel_task" which receives "task_id" from the request parameters.

But, my task is not aborted despite it getting request properly.

Can somebody tell me how to terminate/cancel/stop this task?

Even after cancelling task, this task does not stop executing.

I referred to this document - Abort celery task example

enter image description here task.py

enter image description here views.py

enter image description here Imports in views.py

enter image description here Imports in task.py

Output -

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.