We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64cdaec commit 5a688dcCopy full SHA for 5a688dc
app.py
@@ -137,8 +137,13 @@ def config_changed() -> responses.PlainTextResponse:
137
138
@app.get("/healthcheck")
139
def healthcheck() -> responses.PlainTextResponse:
140
- headers = {"APP": "OK"}
+ text = ""
141
+ status_code = status.HTTP_200_OK
142
database_test = general.test_database_connection()
143
if not database_test.get("success"):
- headers["DATABASE"] = database_test.get("error")
144
- return responses.PlainTextResponse("OK", headers=headers)
+ error_name = database_test.get("error")
145
+ text += f"database_error:{error_name}:"
146
+ status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
147
+ if not text:
148
+ text = "OK"
149
+ return responses.PlainTextResponse(text, status_code=status_code)
0 commit comments