2015-03-28 11 views
5

Ho un progetto Django su un nodo di Ubuntu EC2, che sto usando per impostare un asincrono usando Celery.Come elencare gli elementi in coda in sedano?

Sto seguendo http://michal.karzynski.pl/blog/2014/05/18/setting-up-an-asynchronous-task-queue-for-django-using-celery-redis/ insieme ai documenti.

Sono stato in grado di ottenere un compito fondamentale di lavoro nella riga di comando, utilizzando:

(env1)[email protected]:~/projects/tp$ celery --app=myproject.celery:app worker --loglevel=INFO 

ho appena realizzato, che ho un po 'di compiti a mia coda, che non avevano eseguito:

[2015-03-28 16:49:05,916: WARNING/MainProcess] Restoring 4 unacknowledged message(s). 
(env1)[email protected]:~/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. 

Come si ottiene un elenco degli elementi in coda dalla riga di comando?

risposta

12

Se si desidera ottenere tutte le attività pianificate,

celery inspect scheduled 

trovare tutte le code attive

celery inspect active_queues 

Per lo stato

celery inspect stats 

Per tutti i comandi

celery inspect 

Se si vuole farlo explicitily.Since si utilizza redis come queue.Then

redis-cli 

>KEYS * #find all keys 

Poi scoprire qualcosa legato alla celery

>LLEN KEY # i think it gives length of list 
+0

Grazie! Sto ricevendo un errore con questo però: http://stackoverflow.com/questions/29331280/connection-refused-with-celery – user61629

+0

Ho un seguito su http://stackoverflow.com/questions/29377944/trouble- installazione-supervisord-with-sedano, se sei annoiato. – user61629

+0

Un altro follow up su http://stackoverflow.com/questions/29402447/how-to-set-celeryconfig-file-in-in-django – user61629