MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / clear_cache

Function clear_cache

graphify/cache.py:1888–1903  ·  view source on GitHub ↗

Delete all cache entries (ast/, semantic/, semantic-deep/, and legacy flat entries).

(root: Path = Path("."))

Source from the content-addressed store, hash-verified

1886
1887
1888def clear_cache(root: Path = Path(".")) -> None:
1889 """Delete all cache entries (ast/, semantic/, semantic-deep/, and legacy
1890 flat entries)."""
1891 base = Path(root).resolve() / _GRAPHIFY_OUT / "cache"
1892 # Legacy flat entries
1893 if base.is_dir():
1894 for f in base.glob("*.json"):
1895 f.unlink()
1896 # Namespaced entries, all globbed recursively: ast/ has per-version subdirs,
1897 # semantic-deep/ holds --mode deep entries (#1894), and both semantic kinds
1898 # have per-prompt-fingerprint subdirs (#1939).
1899 for kind in ("ast", "semantic", "semantic-deep"):
1900 d = base / kind
1901 if d.is_dir():
1902 for f in d.glob("**/*.json"):
1903 f.unlink()
1904
1905
1906def prune_semantic_cache(root: Path, live_hashes: set[str]) -> int:

Callers 5

test_clear_cacheFunction · 0.90
_run_extractionFunction · 0.90
mainFunction · 0.90

Calls 1

resolveMethod · 0.45