| """Cache routes — inspection + invalidation.""" | |
| from __future__ import annotations | |
| from fastapi import APIRouter, Depends | |
| from api.deps import get_cache_service | |
| from services.cache_service import CacheService | |
| router = APIRouter() | |
| async def cache_stats(svc: CacheService = Depends(get_cache_service)): | |
| return svc.stats() | |
| async def cache_clear(svc: CacheService = Depends(get_cache_service)): | |
| n = svc.clear() | |
| return {"cleared": n} | |