我可以单独查看和删除Celery / RabbitMQ任务吗? [英] Can I review and delete Celery / RabbitMQ tasks individually?

查看:222
本文介绍了我可以单独查看和删除Celery / RabbitMQ任务吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Django + Celery + RabbitMQ。修改了一些任务名称后,即使从Django Celery Beat的Periodic Tasks表中使用此密钥删除任务并重新启动Celery worker,我也开始收到未注册任务 KeyErrors。

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.

事实证明, Celery / RabbitMQ任务是持久的。我最终通过将旧版任务重新实现为虚拟方法来解决了该问题。

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

将来,我不希望清除队列,重新启动工作程序或重新实现旧方法。相反,我想检查队列并分别删除所有旧任务。这可能吗? (最好是在Django管理界面中。)

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.)

推荐答案

芹菜检查可能会帮助

查看活动队列:

celery -A proj inspect active_queues

要终止进程,请执行以下操作:

To terminate a process:

celery -A proj control invoke process_id

所有可用的检查选项:

celery inspect --help

这篇关于我可以单独查看和删除Celery / RabbitMQ任务吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆