forked from mtusi2026/mtusi2026lab5
21 lines
501 B
Python
21 lines
501 B
Python
from fastapi import APIRouter, Request
|
|
|
|
from app.domain import health
|
|
from app.schemas.base import Health
|
|
|
|
router = APIRouter(prefix='/health', tags=['health'])
|
|
|
|
|
|
@router.get('/live')
|
|
async def liveness() -> Health:
|
|
return health.liveness()
|
|
|
|
|
|
@router.get('/ready')
|
|
async def readiness(request: Request) -> Health:
|
|
state = request.app.state
|
|
return await health.readiness(
|
|
state.engine, state.redis, state.s3, state.lifecycle,
|
|
state.settings.readiness_timeout_seconds,
|
|
)
|