我在Ubuntu EC2节点上有一个Django项目,我一直在使用它来设置异步Celery。
Celery
我正在跟文档一起关注http://michal.karzynski.pl/blog/2014/05/18/setting-up-an- asynchronous-task-queue-for-django-using-celery- redis/。
我已经可以使用以下命令在命令行上执行基本任务:
(env1)ubuntu@ip-172-31-22-65:~/projects/tp$ celery --app=myproject.celery:app worker --loglevel=INFO
我刚刚意识到,队列中有一堆尚未执行的任务:
[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.
如何从命令行获取排队项目的列表?
如果您想获取所有预定任务,
celery inspect scheduled
查找所有活动队列
celery inspect active_queues
地位
celery inspect stats
对于所有命令
celery inspect
如果您想显式地获取它,因为您正在redis用作队列。
redis
redis-cli >KEYS * #find all keys
然后找出与 celery
celery
>LLEN KEY # i think it gives length of list