fix main.py
This commit is contained in:
@@ -14,11 +14,11 @@ def root():
|
|||||||
@app.get("/health")
|
@app.get("/health")
|
||||||
def health():
|
def health():
|
||||||
if not _healthy:
|
if not _healthy:
|
||||||
return JSONResponse(status_code=500, content={"status": "unhealthy"})
|
return {"status": "unhealthy"}, 503
|
||||||
return {"status": "ok"}
|
return {"status": "ok"}
|
||||||
|
|
||||||
@app.post("/break")
|
@app.post("/break")
|
||||||
def break_health():
|
def break_health():
|
||||||
global _healthy
|
global _healthy
|
||||||
_healthy = False
|
_healthy = False
|
||||||
return {"message": "Servis je sada nezdrav — ocekuj restart"}
|
return {"message": "Servis je sada nezdrav"}
|
||||||
Reference in New Issue
Block a user