Domanda

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?

È stato utile?

Soluzione

There are several ways to ultimately find out. While it's processing the best way to do this is to use the tools in celery. For a given task_id do this.

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}]}}    

The delivery_info tells you the exchange which is the queue name.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top