Skip to content

Commit bd6335d

Browse files
committed
Fix error code on healthcheck failure
1 parent 4ef9f77 commit bd6335d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

root/app/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ async def get_status():
2626
async def health():
2727
try:
2828
content = await get_status()
29-
return JSONResponse(content=content)
29+
status_code = 200 if content == "Success" else 500
30+
return JSONResponse(content=content, status_code=status_code)
3031
except Exception:
3132
print(traceback.format_exc())
3233
raise HTTPException(status_code=404, detail="Not found")

0 commit comments

Comments
 (0)