Initialize cache. Args: ttl_seconds: Time-to-live for cache entries in seconds
(self, ttl_seconds: int = DEFAULT_TTL)
| 39 | """Manages caching of scan results.""" |
| 40 | |
| 41 | DEFAULT_TTL = 24 * 3600 # 24 hours in seconds |
| 42 | |
| 43 | def __init__(self, ttl_seconds: int = DEFAULT_TTL): |
| 44 | """Initialize cache. |
| 45 | |
| 46 | Args: |
| 47 | ttl_seconds: Time-to-live for cache entries in seconds |
| 48 | """ |
| 49 | self.ttl = ttl_seconds |
| 50 | self.cache_dir = get_settings().data_dir / "cache" |
| 51 | self.cache_dir.mkdir(parents=True, exist_ok=True) |
| 52 | self._memory_cache: dict[str, CacheEntry] = {} |
| 53 | logger.info(f"Initialized scan cache with TTL={ttl_seconds}s at {self.cache_dir}") |
| 54 |
nothing calls this directly
no test coverage detected