Реализовать Lab 3: балансировка и отказоустойчивость

This commit is contained in:
2026-10-27 22:05:10 +03:00
parent 0ab3a341aa
commit cc51344be3
50 changed files with 1434 additions and 47 deletions
+17
View File
@@ -0,0 +1,17 @@
from fastapi import APIRouter, Request
from app.core.errors import ApiError
router = APIRouter()
@router.get('/health/live')
async def live():
return {'status': 'ok'}
@router.get('/health/ready')
async def ready(request: Request):
if not await request.app.state.storage.ready():
raise ApiError(503, 'Storage is unavailable')
return {'status': 'ok'}