MCPcopy Index your code
hub / github.com/github/spec-kit / clear_cache

Method clear_cache

src/specify_cli/extensions/__init__.py:2642–2654  ·  view source on GitHub ↗

Clear the catalog cache (both legacy and URL-hash-based files).

(self)

Source from the content-addressed store, hash-verified

2640 raise ExtensionError(f"Failed to save extension ZIP: {e}")
2641
2642 def clear_cache(self):
2643 """Clear the catalog cache (both legacy and URL-hash-based files)."""
2644 if self.cache_file.exists():
2645 self.cache_file.unlink()
2646 if self.cache_metadata_file.exists():
2647 self.cache_metadata_file.unlink()
2648 # Also clear any per-URL hash-based cache files
2649 if self.cache_dir.exists():
2650 for extra_cache in self.cache_dir.glob("catalog-*.json"):
2651 if extra_cache != self.cache_file:
2652 extra_cache.unlink(missing_ok=True)
2653 for extra_meta in self.cache_dir.glob("catalog-*-metadata.json"):
2654 extra_meta.unlink(missing_ok=True)
2655
2656
2657class ConfigManager:

Callers 1

test_clear_cacheMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_clear_cacheMethod · 0.76