внес правки
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-10-24 10:56:29 +03:00
parent 6dbc2da1ca
commit 5b15688149
19 changed files with 356 additions and 181 deletions
+13 -2
View File
@@ -1,4 +1,8 @@
from fastapi import APIRouter
from fastapi import HTTPException
from sqlalchemy import text
from app.database import async_session_maker
from app.redis_client import redis_client
router = APIRouter(tags=["health"])
@@ -10,9 +14,16 @@ def live():
@router.get("/health/ready")
def ready():
return {"status": "ok"}
async def ready():
try:
async with async_session_maker() as session:
await session.execute(text("SELECT 1"))
await redis_client.ping()
return {"status": "ok"}
except Exception:
raise HTTPException(status_code=503, detail="unavailable")
@router.get("/")
def home():