From bd6335dd71f350988fc6bee7c6fed40cf073f3bc Mon Sep 17 00:00:00 2001 From: quietsy Date: Tue, 19 Aug 2025 20:57:28 +0300 Subject: [PATCH] Fix error code on healthcheck failure --- root/app/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/root/app/api.py b/root/app/api.py index 414d3d2..5ce1444 100644 --- a/root/app/api.py +++ b/root/app/api.py @@ -26,7 +26,8 @@ async def get_status(): async def health(): try: content = await get_status() - return JSONResponse(content=content) + status_code = 200 if content == "Success" else 500 + return JSONResponse(content=content, status_code=status_code) except Exception: print(traceback.format_exc()) raise HTTPException(status_code=404, detail="Not found")