mirror of https://github.com/rq/rq.git
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.
This commit is contained in:
parent
2e5f537abd
commit
59aebf8676
19
bin/rqinfo
19
bin/rqinfo
|
@ -83,19 +83,22 @@ def show_workers(args):
|
||||||
|
|
||||||
# Filter out workers that don't match the queue filter
|
# Filter out workers that don't match the queue filter
|
||||||
ws = [w for w in Worker.all() if any_matching_queue(w)]
|
ws = [w for w in Worker.all() if any_matching_queue(w)]
|
||||||
else:
|
|
||||||
qs = Queue.all()
|
|
||||||
ws = Worker.all()
|
|
||||||
|
|
||||||
if not args.by_queue:
|
|
||||||
def filter_queues(queue_names):
|
def filter_queues(queue_names):
|
||||||
return [qname for qname in queue_names if Queue(qname) in qs]
|
return [qname for qname in queue_names if Queue(qname) in qs]
|
||||||
|
|
||||||
for w in ws:
|
|
||||||
if not args.raw:
|
|
||||||
print '%s %s: %s' % (w.name, state_symbol(w.state), ', '.join(filter_queues(w.queue_names())))
|
|
||||||
else:
|
else:
|
||||||
print 'worker %s %s %s' % (w.name, w.state, ','.join(filter_queues(w.queue_names())))
|
qs = Queue.all()
|
||||||
|
ws = Worker.all()
|
||||||
|
filter_queues = lambda x: x
|
||||||
|
|
||||||
|
if not args.by_queue:
|
||||||
|
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(worker_queues))
|
||||||
|
else:
|
||||||
|
print 'worker %s %s %s' % (w.name, w.state, ','.join(worker_queues))
|
||||||
else:
|
else:
|
||||||
# Create reverse lookup table
|
# Create reverse lookup table
|
||||||
queues = {q: [] for q in qs}
|
queues = {q: [] for q in qs}
|
||||||
|
|
Loading…
Reference in New Issue