MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / invalidateCache

Function invalidateCache

packages/node-runtime/src/cache/session-cache.ts:63–78  ·  view source on GitHub ↗
(sessionId: string, cacheDir: string, key?: string)

Source from the content-addressed store, hash-verified

61}
62
63export function invalidateCache(sessionId: string, cacheDir: string, key?: string): void {
64 const cachePath = getCachePath(sessionId, cacheDir)
65 try {
66 if (!key) {
67 if (fs.existsSync(cachePath)) fs.unlinkSync(cachePath)
68 } else {
69 const file = readCacheFile(cachePath)
70 if (file && file[key]) {
71 delete file[key]
72 writeCacheFile(cachePath, file)
73 }
74 }
75 } catch {
76 // Ignore
77 }
78}
79
80export function deleteSessionCache(sessionId: string, cacheDir: string): void {
81 const cachePath = getCachePath(sessionId, cacheDir)

Callers

nothing calls this directly

Calls 3

getCachePathFunction · 0.85
readCacheFileFunction · 0.85
writeCacheFileFunction · 0.85

Tested by

no test coverage detected