Shaurya Pratap
Shaurya Pratap

Reputation: 61

Need to know the syntax for storing task id in statedb for persistent revokes of a celery task

I was looking into the celery documentation for persistent revokes of celery tasks and there is a point that whenever workers are restarted the revoked list of tasks id are lost since its stored in-memory. So the solution mentioned over there is to store the task id list in a file and add a variable --statedb=<path to the file> at the time of starting workers. But i can not find the format of the file. If anyone can guide me through the it would be really appreciated.

doc for reference: http://docs.celeryproject.org/en/latest/userguide/workers.html#persistent-revokes

Upvotes: 0

Views: 233

Answers (1)

Mauro Rocco
Mauro Rocco

Reputation: 5128

Well if you look at the configuration default you can actually enable the feature also via code. When you do this Celery will automatically store in this file the revoked tasks.

What you can do than is just enable it try to revoke some tasks and than open the file to see what it contains.

For my understanding you should just activate it and than Celery will take care of keep this file updated so you will probably don't need to do anything with it because when worker restart will already check the file.

Upvotes: 0

Related Questions