MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / __init__

Method __init__

mt-tools/src/mt/cache.py:45–58  ·  view source on GitHub ↗

Initialize cache. Args: cache_path: Path to DuckDB file (None to disable) rewrite: If True, ignore cached values but still write new ones

(self, cache_path: str = "task_cache.duckdb", rewrite: bool = False)

Source from the content-addressed store, hash-verified

43 """
44
45 def __init__(self, cache_path: str = "task_cache.duckdb", rewrite: bool = False):
46 """Initialize cache.
47
48 Args:
49 cache_path: Path to DuckDB file (None to disable)
50 rewrite: If True, ignore cached values but still write new ones
51 """
52 self.cache_path = cache_path
53 self.enabled = cache_path is not None
54 self.rewrite = rewrite
55 self._local = threading.local()
56 self._lock = threading.Lock()
57 if self.enabled:
58 self._init_db()
59
60 def _get_conn(self):
61 """Get thread-local connection."""

Callers

nothing calls this directly

Calls 1

_init_dbMethod · 0.95

Tested by

no test coverage detected