mirror of
https://github.com/goauthentik/authentik.git
synced 2026-08-30 18:51:39 -07:00
root: handle JSON error in metrics too
this can happen when the worker is killed while writing metrics
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Metrics view"""
|
||||
from base64 import b64encode
|
||||
from json import JSONDecodeError
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import connections
|
||||
@@ -33,7 +34,7 @@ class MetricsView(View):
|
||||
|
||||
try:
|
||||
return ExportToDjangoView(request)
|
||||
except (UnicodeDecodeError, KeyError, ValueError):
|
||||
except (UnicodeDecodeError, KeyError, ValueError, JSONDecodeError):
|
||||
return HttpResponse(status_code=500)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user