Reads wiki cache data from the file system.
(owner: str, repo: str, repo_type: str, language: str)
| 411 | return os.path.join(WIKI_CACHE_DIR, filename) |
| 412 | |
| 413 | async 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 | |
| 426 | async def save_wiki_cache(data: WikiCacheRequest) -> bool: |
| 427 | """Saves wiki cache data to the file system.""" |
no test coverage detected