diff --git a/authentik/admin/api/workers.py b/authentik/admin/api/workers.py index c4fe3f5ba..5b8e12848 100644 --- a/authentik/admin/api/workers.py +++ b/authentik/admin/api/workers.py @@ -1,4 +1,5 @@ """authentik administration overview""" +from django.conf import settings from drf_spectacular.utils import extend_schema, inline_serializer from prometheus_client import Gauge from rest_framework.fields import IntegerField @@ -21,4 +22,7 @@ class WorkerView(APIView): def get(self, request: Request) -> Response: """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: + count += 1 return Response({"count": count})