from fastapi import APIRouter from app.services import storage router = APIRouter(tags=["health"]) @router.get("/health") def health_check(): redis_ok = storage.ping() return { "status": "ok" if redis_ok else "degraded", "redis": "connected" if redis_ok else "disconnected", }