MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / __init__

Method __init__

core/cache.py:41–51  ·  view source on GitHub ↗

Initialize cache. Args: ttl_seconds: Time-to-live for cache entries in seconds

(self, ttl_seconds: int = DEFAULT_TTL)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

get_settingsFunction · 0.90

Tested by

no test coverage detected