Simple question. How can I determine which queue the job went to when I have multiple queues defined. While I know I said go to the priority queue - how can I check to see if in fact that's the case?
问问题
121 次
1 回答
0
有几种方法可以最终找出答案。虽然它正在处理,但最好的方法是使用 celery 中的工具。对于给定的 task_id 执行此操作。
from celery.app import app_or_default
app = app_or_default()
inspect = app.control.inspect()
pprint.pprint(inspect.query_task([task_id]))
{u'celery@adeline.xxx.com':
{u'ebe2d165-92f6-4c81-bbf5-b2644e0dbcaf':
[u'reserved',
{u'acknowledged': False,
u'args': u'[]',
u'delivery_info': {u'exchange': u'celery',
u'priority': None,
u'redelivered': False,
u'routing_key': u'celery'},
u'hostname': u'celery@adeline.xxx.com',
u'id': u'ebe2d165-92f6-4c81-bbf5-b2644e0dbcaf',
u'kwargs': u"{'status_ids': [5072L, 7643L]}",
u'name': u'apps.home.tasks.update_home_stats',
u'time_start': None,
u'worker_pid': None}]}}
delivery_info
告诉您交换是队列名称。
于 2014-04-11T12:38:55.433 回答