mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-23 13:28:12 +08:00
checks if broker has lock_size method
This commit is contained in:
+1
-2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user