replyflow-rag / api /routes /admin.py
Qurrah's picture
ADD: implement cache clearing endpoint in admin router
5121523
Raw History Blame Contribute Delete
441 Bytes
import logging
from fastapi import APIRouter, Security
from core.security import verify_api_key
from services.cache_service import clear_all_caches
logger = logging.getLogger(__name__)
router = APIRouter(tags=["admin"])
@router.post("/admin/cache-clear")
async def clear_cache(_: str = Security(verify_api_key)):
clear_all_caches()
logger.info("Cache manually cleared")
return {"status": "ok", "message": "Cache cleared"}