adds queue_size()

returns the size of the current redis queue
This commit is contained in:
Ilan
2015-08-13 15:54:57 +02:00
parent 204377228f
commit 3d12c1d36e
5 changed files with 29 additions and 8 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ from django.utils import timezone
from django_q.conf import redis_client
from django_q.cluster import pusher, worker, monitor, scheduler
from django_q.tasks import Schedule, fetch, schedule as create_schedule
from django_q.tasks import Schedule, fetch, schedule as create_schedule, queue_size
@pytest.fixture
@@ -34,7 +34,7 @@ def test_scheduler(r):
# push it
pusher(task_queue, stop_event, list_key=list_key, r=r)
assert task_queue.qsize() == 1
assert r.llen(list_key) == 0
assert queue_size(list_key=list_key,r=r) == 0
task_queue.put('STOP')
# let a worker handle them
result_queue = Queue()