SPerva's picture
Sync Space from GitHub c15b8ee76b1f7967bcedd07a6909b7ef899c2157
c30608d verified
Raw History Blame Contribute Delete
549 Bytes
"""Admin endpoints for cache management."""
import logging
from fastapi import APIRouter
from app.clients import openfda_client, rxnorm_client
logger = logging.getLogger(__name__)
router = APIRouter(prefix="/admin", tags=["admin"])
@router.post("/cache/clear")
async def clear_cache():
"""Clear all in-memory caches. Requires API key authentication."""
rxnorm_client._cache.clear()
openfda_client._cache.clear()
logger.info("All caches cleared via admin endpoint")
return {"status": "ok", "message": "All caches cleared"}