如何列出芹菜中的排队物品? [英] How to list the queued items in celery?
问题描述
我在Ubuntu EC2节点上有一个Django项目,我一直在使用 Celery
来设置异步。
I have a Django project on an Ubuntu EC2 node, which I have been using to set up an asynchronous using Celery
.
I am following http://michal.karzynski.pl/blog/2014/05/18/setting-up-an-asynchronous-task-queue-for-django-using-celery-redis/ along with the docs.
我已经能够在命令行中使用以下功能获得基本任务:
I've been able to get a basic task working at the command line, using:
(env1)ubuntu@ip-172-31-22-65:~/projects/tp$ celery --app=myproject.celery:app worker --loglevel=INFO
我刚刚意识到,我的队列中有一堆任务,没有执行:
I just realized, that I have a bunch of tasks in my queue, that had not executed:
[2015-03-28 16:49:05,916: WARNING/MainProcess] Restoring 4 unacknowledged message(s).
(env1)ubuntu@ip-172-31-22-65:~/projects/tp$ celery -A tp purge
WARNING: This will remove all tasks from queue: celery.
There is no undo for this operation!
(to skip this prompt use the -f option)
Are you sure you want to delete all tasks (yes/NO)? yes
Purged 81 messages from 1 known task queue.
如何从命令行获取排队的项目列表?
How do I get a list of the queued items from the command line?
推荐答案
如果你想获得所有计划的任务,
If you want to get all scheduled tasks,
celery inspect scheduled
查找所有活动队列
celery inspect active_queues
状态
celery inspect stats
对于所有命令
celery inspect
如果你想明确地得到它。因为你使用 redis
作为queue.Then
If you want to get it explicitily.Since you are using redis
as queue.Then
redis-cli
>KEYS * #find all keys
然后找出与芹菜相关的东西
>LLEN KEY # i think it gives length of list
这篇关于如何列出芹菜中的排队物品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!