mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-05 12:28:12 +08:00
fixes connection creation on import
This commit is contained in:
+3
-2
@@ -152,16 +152,17 @@ def delete_group(group_id, tasks=False):
|
||||
return Task.delete_group(group_id, tasks)
|
||||
|
||||
|
||||
def queue_size(broker=get_broker()):
|
||||
def queue_size(broker=None):
|
||||
"""
|
||||
Returns the current queue size.
|
||||
Note that this doesn't count any tasks currently being processed by workers.
|
||||
|
||||
:param list_key: optional list key
|
||||
:param broker: optional broker
|
||||
:return: current queue size
|
||||
:rtype: int
|
||||
"""
|
||||
if not broker:
|
||||
broker = get_broker()
|
||||
return broker.queue_size()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user