(sessionId: string, cacheDir: string, key?: string)
| 61 | } |
| 62 | |
| 63 | export 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 | |
| 80 | export function deleteSessionCache(sessionId: string, cacheDir: string): void { |
| 81 | const cachePath = getCachePath(sessionId, cacheDir) |
nothing calls this directly
no test coverage detected