File size: 523 Bytes
aac350d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""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()


@router.get("")
@router.get("/")
async def cache_stats(svc: CacheService = Depends(get_cache_service)):
    return svc.stats()


@router.delete("")
@router.delete("/")
async def cache_clear(svc: CacheService = Depends(get_cache_service)):
    n = svc.clear()
    return {"cleared": n}