17 lines
374 B
Python
17 lines
374 B
Python
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'} |