From 6af852fceec0772081099374b3bcc8b586e1f710 Mon Sep 17 00:00:00 2001 From: Ilan Steemers Date: Fri, 18 Sep 2015 15:23:31 +0200 Subject: [PATCH] checks if broker has lock_size method --- django_q/monitor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/django_q/monitor.py b/django_q/monitor.py index 96c8308..3671e83 100644 --- a/django_q/monitor.py +++ b/django_q/monitor.py @@ -83,7 +83,7 @@ def monitor(run_once=False, broker=None): # bottom bar i += 1 queue_size = broker.queue_size() - if Conf.ORM: + if hasattr(broker, 'lock_size'): queue_size = '{}({})'.format(queue_size, broker.lock_size()) print(term.move(i, 0) + term.white_on_cyan(term.center(broker.info(), width=col_width * 2))) print(term.move(i, 2 * col_width) + term.black_on_cyan(term.center(_('Queued'), width=col_width))) @@ -183,4 +183,3 @@ def info(broker=None): term.white('{0:.4f}'.format(exec_time)) ) return True -