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

Method add_to_cache

codewiki/src/fe/cache_manager.py:84–97  ·  view source on GitHub ↗

Add documentation to cache.

(self, repo_url: str, docs_path: str)

Source from the content-addressed store, hash-verified

82 return None
83
84 def add_to_cache(self, repo_url: str, docs_path: str):
85 """Add documentation to cache."""
86 repo_hash = self.get_repo_hash(repo_url)
87 now = datetime.now()
88
89 self.cache_index[repo_hash] = CacheEntry(
90 repo_url=repo_url,
91 repo_url_hash=repo_hash,
92 docs_path=docs_path,
93 created_at=now,
94 last_accessed=now
95 )
96
97 self.save_cache_index()
98
99 def remove_from_cache(self, repo_url: str):
100 """Remove documentation from cache."""

Callers 1

_process_jobMethod · 0.80

Calls 3

get_repo_hashMethod · 0.95
save_cache_indexMethod · 0.95
CacheEntryClass · 0.85

Tested by

no test coverage detected