File size: 441 Bytes
5121523
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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"}