admin: add more tests

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-11-15 20:05:13 +01:00
parent d5341c2284
commit e4095dfffe
4 changed files with 30 additions and 3 deletions

View File

@ -23,6 +23,6 @@ class WorkerView(APIView):
"""Get currently connected worker count."""
count = len(CELERY_APP.control.ping(timeout=0.5))
# In debug we run with `CELERY_TASK_ALWAYS_EAGER`, so tasks are ran on the main process
if settings.DEBUG:
if settings.DEBUG: # pragma: no cover
count += 1
return Response({"count": count})