MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / load_cache_index

Method load_cache_index

codewiki/src/fe/cache_manager.py:26–41  ·  view source on GitHub ↗

Load cache index from disk.

(self)

Source from the content-addressed store, hash-verified

24 self.load_cache_index()
25
26 def load_cache_index(self):
27 """Load cache index from disk."""
28 index_file = self.cache_dir / "cache_index.json"
29 if index_file.exists():
30 try:
31 data = file_manager.load_json(index_file)
32 for key, value in data.items():
33 self.cache_index[key] = CacheEntry(
34 repo_url=value['repo_url'],
35 repo_url_hash=value['repo_url_hash'],
36 docs_path=value['docs_path'],
37 created_at=datetime.fromisoformat(value['created_at']),
38 last_accessed=datetime.fromisoformat(value['last_accessed'])
39 )
40 except Exception as e:
41 print(f"Error loading cache index: {e}")
42
43 def save_cache_index(self):
44 """Save cache index to disk."""

Callers 1

__init__Method · 0.95

Calls 2

CacheEntryClass · 0.85
load_jsonMethod · 0.80

Tested by

no test coverage detected