From 59aebf8676c46680a37d73776ef55e8f8c1e67a1 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 27 Mar 2012 12:17:39 +0200 Subject: [PATCH] Don't filter when no queues are explicitly specified. This caused the workers from omitting empty queues from workers, as if they were not listening on them. --- bin/rqinfo | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/rqinfo b/bin/rqinfo index ea3eebf..496ee02 100755 --- a/bin/rqinfo +++ b/bin/rqinfo @@ -83,19 +83,22 @@ def show_workers(args): # Filter out workers that don't match the queue filter ws = [w for w in Worker.all() if any_matching_queue(w)] + + def filter_queues(queue_names): + return [qname for qname in queue_names if Queue(qname) in qs] + else: qs = Queue.all() ws = Worker.all() + filter_queues = lambda x: x if not args.by_queue: - def filter_queues(queue_names): - return [qname for qname in queue_names if Queue(qname) in qs] - for w in ws: + worker_queues = filter_queues(w.queue_names()) if not args.raw: - print '%s %s: %s' % (w.name, state_symbol(w.state), ', '.join(filter_queues(w.queue_names()))) + print '%s %s: %s' % (w.name, state_symbol(w.state), ', '.join(worker_queues)) else: - print 'worker %s %s %s' % (w.name, w.state, ','.join(filter_queues(w.queue_names()))) + print 'worker %s %s %s' % (w.name, w.state, ','.join(worker_queues)) else: # Create reverse lookup table queues = {q: [] for q in qs}