File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,13 @@ async def export_ws_stats(request: ExportWsStatsRequest) -> responses.PlainTextR
9191
9292@app .get ("/healthcheck" )
9393def healthcheck () -> responses .PlainTextResponse :
94- headers = {"APP" : "OK" }
94+ text = ""
95+ status_code = status .HTTP_200_OK
9596 database_test = general .test_database_connection ()
9697 if not database_test .get ("success" ):
97- headers ["DATABASE" ] = database_test .get ("error" )
98- return responses .PlainTextResponse ("OK" , headers = headers )
98+ error_name = database_test .get ("error" )
99+ text += f"database_error:{ error_name } :"
100+ status_code = status .HTTP_500_INTERNAL_SERVER_ERROR
101+ if not text :
102+ text = "OK"
103+ return responses .PlainTextResponse (text , status_code = status_code )
You can’t perform that action at this time.
0 commit comments