MCPcopy Index your code
hub / github.com/getagentseal/codeburn / loadCache

Function loadCache

src/codex-cache.ts:38–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36let memCache: ResultCache | null = null
37
38async function loadCache(): Promise<ResultCache> {
39 if (memCache) return memCache
40 try {
41 const raw = await readFile(getCachePath(), 'utf-8')
42 const cache = JSON.parse(raw) as ResultCache
43 if (cache.version === CODEX_CACHE_VERSION && cache.files && typeof cache.files === 'object') {
44 memCache = cache
45 return cache
46 }
47 } catch {}
48 memCache = { version: CODEX_CACHE_VERSION, files: {} }
49 return memCache
50}
51
52function getEntry(cache: ResultCache, filePath: string, fp: FileFingerprint): FileEntry | null {
53 if (!Object.hasOwn(cache.files, filePath)) return null

Callers 5

parseAllSessionsFunction · 0.70
readCachedCodexResultsFunction · 0.70
getCachedCodexProjectFunction · 0.70
writeCachedCodexResultsFunction · 0.70

Calls 2

parseMethod · 0.80
getCachePathFunction · 0.70

Tested by

no test coverage detected