MCPcopy Create free account
hub / github.com/AsyncFuncAI/deepwiki-open / read_wiki_cache

Function read_wiki_cache

api/api.py:413–424  ·  view source on GitHub ↗

Reads wiki cache data from the file system.

(owner: str, repo: str, repo_type: str, language: str)

Source from the content-addressed store, hash-verified

411 return os.path.join(WIKI_CACHE_DIR, filename)
412
413async def read_wiki_cache(owner: str, repo: str, repo_type: str, language: str) -> Optional[WikiCacheData]:
414 """Reads wiki cache data from the file system."""
415 cache_path = get_wiki_cache_path(owner, repo, repo_type, language)
416 if os.path.exists(cache_path):
417 try:
418 with open(cache_path, 'r', encoding='utf-8') as f:
419 data = json.load(f)
420 return WikiCacheData(**data)
421 except Exception as e:
422 logger.error(f"Error reading wiki cache from {cache_path}: {e}")
423 return None
424 return None
425
426async def save_wiki_cache(data: WikiCacheRequest) -> bool:
427 """Saves wiki cache data to the file system."""

Callers 1

get_cached_wikiFunction · 0.85

Calls 2

get_wiki_cache_pathFunction · 0.85
WikiCacheDataClass · 0.70

Tested by

no test coverage detected