Spaces:
Sleeping
Sleeping
Download app/api/routes/health.py from AnishDev/coderound-task-backend: direct link, hf CLI and curl.
- Browser
- Download file 308 Bytes
-
https://huggingface.co/spaces/AnishDev/coderound-task-backend/resolve/main/app/api/routes/health.py
- Command line
-
hf download hf://spaces/AnishDev/coderound-task-backend/app/api/routes/health.py
-
curl -L -o health.py https://huggingface.co/spaces/AnishDev/coderound-task-backend/resolve/main/app/api/routes/health.py
308 Bytes
| from fastapi import APIRouter | |
| from app.services import storage | |
| router = APIRouter(tags=["health"]) | |
| def health_check(): | |
| redis_ok = storage.ping() | |
| return { | |
| "status": "ok" if redis_ok else "degraded", | |
| "redis": "connected" if redis_ok else "disconnected", | |
| } | |