1

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?

4

1 に答える 1

0

最終的に調べる方法はいくつかあります。これを処理している間、これを行う最善の方法は、セロリでツールを使用することです。特定の 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 に答える