Download services/cache_service.py from Hellbound237/face-intel: direct link, hf CLI and curl.
- Browser
- Download file 484 Bytes
-
https://huggingface.co/Hellbound237/face-intel/resolve/main/services/cache_service.py
- Command line
-
hf download hf://Hellbound237/face-intel/services/cache_service.py
-
curl -L -o cache_service.py https://huggingface.co/Hellbound237/face-intel/resolve/main/services/cache_service.py
484 Bytes
| """Cache service — inspection + invalidation.""" | |
| from __future__ import annotations | |
| from storage.cache import Cache | |
| class CacheService: | |
| """Read-mostly cache facade.""" | |
| def __init__(self, cache: Cache) -> None: | |
| self._cache = cache | |
| def stats(self) -> dict: | |
| return self._cache.stats() | |
| def invalidate(self, key: str) -> bool: | |
| return self._cache.invalidate(key) | |
| def clear(self) -> int: | |
| n = self._cache.clear() | |
| return n | |