lab4: S3, MinIO, reconciler, трек 2, README

This commit is contained in:
2026-11-12 20:14:39 +03:00
parent ec540a1a72
commit d88f77cccc
104 changed files with 204719 additions and 47 deletions
+34
View File
@@ -0,0 +1,34 @@
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"])
@router.get("/health/live")
def live():
return {"status": "ok"}
@router.get("/health/ready")
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():
return {
"service": "MTUSI Messenger",
"version": "1.1.0",
"docs": "/docs",
}