From 93b960a1f1dbe6a949e8cfddc1c97cf8dc713923 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Tue, 4 Jun 2024 14:35:26 +0200 Subject: [PATCH] root: monitoring: force db connection reload before healthcheck Signed-off-by: Marc 'risson' Schmitt --- authentik/root/monitoring.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/authentik/root/monitoring.py b/authentik/root/monitoring.py index b6ce04306e..6f4edfcb18 100644 --- a/authentik/root/monitoring.py +++ b/authentik/root/monitoring.py @@ -48,6 +48,8 @@ class ReadyView(View): def dispatch(self, request: HttpRequest) -> HttpResponse: try: for db_conn in connections.all(): + # Force connection reload + db_conn.connect() _ = db_conn.cursor() except OperationalError: # pragma: no cover return HttpResponse(status=503)