Skip to content

Commit 0715455

Browse files
healthcheck extension (#121)
* Updates submodule * Extends healthcheck with database logic * Adds healthcheck for database * Adds databasehealthcheck * Updates submodule * Cleans up database healthcheck endpoint * Updates submodule * Combines checks into one endpoint
1 parent 4f4d8b7 commit 0715455

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

api/healthcheck.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from starlette.endpoints import HTTPEndpoint
22
from starlette.responses import PlainTextResponse
3+
from submodules.model.business_objects import general
34

45

56
class Healthcheck(HTTPEndpoint):
67
def get(self, request) -> PlainTextResponse:
7-
return PlainTextResponse("OK")
8+
headers = {"APP": "OK"}
9+
database_test = general.test_database_connection()
10+
if not database_test.get("success"):
11+
headers["DATABASE"] = database_test.get("error")
12+
return PlainTextResponse("OK", headers=headers)

submodules/model

0 commit comments

Comments
 (0)