Skip to content

Commit 64cdaec

Browse files
Adds healthcheck (#33)
* Aadds healthcheck * updates submodule
1 parent f0b1fd1 commit 64cdaec

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,12 @@ def upload_tensor_data(
133133
def config_changed() -> responses.PlainTextResponse:
134134
config_handler.refresh_config()
135135
return responses.PlainTextResponse(status_code=status.HTTP_200_OK)
136+
137+
138+
@app.get("/healthcheck")
139+
def healthcheck() -> responses.PlainTextResponse:
140+
headers = {"APP": "OK"}
141+
database_test = general.test_database_connection()
142+
if not database_test.get("success"):
143+
headers["DATABASE"] = database_test.get("error")
144+
return responses.PlainTextResponse("OK", headers=headers)

0 commit comments

Comments
 (0)