Can I review and delete Celery / RabbitMQ tasks individually?

北城余情 提交于 2019-12-11 05:11:54

问题


I am running Django + Celery + RabbitMQ. After modifying some task names I started getting "unregistered task" KeyErrors, even after removing tasks with this key from the Periodic tasks table in Django Celery Beat and restarting the Celery worker.

It turns out Celery / RabbitMQ tasks are persistent. I eventually resolved the issue by reimplementing the legacy tasks as dummy methods.

In future, I'd prefer not to purge the queue, restart the worker or reimplement legacy methods. Instead I'd like to inspect the queue and individually delete any legacy tasks. Is this possible? (Preferably in the context of the Django admin interface.)


回答1:


Celery inspect may help

To view active queues:

celery -A proj inspect active_queues

To terminate a process:

celery -A proj control invoke process_id

To see all availble inspect options:

celery inspect --help


来源:https://stackoverflow.com/questions/45917413/can-i-review-and-delete-celery-rabbitmq-tasks-individually

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!