0

After reading docs; what I understand is that you cannot rerun celery tasks outside of application contexts. Initially; what i thought was; terminated task would resume running once the worker has been restarted; however it didn't. I am currently using

celery.control.terminate(task_id)

That terminates my celery task id; I then tried running a worker with the same name hoping my revoked task would resume and finish; it didn't. After doing bit of research; I saw that a task can be reran with the same arguments; I thought MAYBE it would resume if I reran the same task again, it didn't. How can I revoke a task - then be able to re run it.

I'm using .apply_async() to intiate my task.

davidism
  • 121,510
  • 29
  • 395
  • 339
Biplov
  • 1,136
  • 1
  • 20
  • 44

1 Answers1

0

Use revoke instead of terminate e.g:

celery_app.control.revoke(task_id)

you can refer this solution as well.

Cancel an already executing task with Celery?

Malik Faiq
  • 433
  • 6
  • 18