Save cache index to disk.
(self)
| 41 | print(f"Error loading cache index: {e}") |
| 42 | |
| 43 | def save_cache_index(self): |
| 44 | """Save cache index to disk.""" |
| 45 | index_file = self.cache_dir / "cache_index.json" |
| 46 | try: |
| 47 | data = {} |
| 48 | for key, entry in self.cache_index.items(): |
| 49 | data[key] = { |
| 50 | 'repo_url': entry.repo_url, |
| 51 | 'repo_url_hash': entry.repo_url_hash, |
| 52 | 'docs_path': entry.docs_path, |
| 53 | 'created_at': entry.created_at.isoformat(), |
| 54 | 'last_accessed': entry.last_accessed.isoformat() |
| 55 | } |
| 56 | |
| 57 | file_manager.save_json(data, index_file) |
| 58 | except Exception as e: |
| 59 | print(f"Error saving cache index: {e}") |
| 60 | |
| 61 | def get_repo_hash(self, repo_url: str) -> str: |
| 62 | """Generate hash for repository URL.""" |
no test coverage detected