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

Function cacheKey

src/parser.ts:2239–2248  ·  view source on GitHub ↗
(dateRange?: DateRange, providerFilter?: string)

Source from the content-addressed store, hash-verified

2237const sessionCache = new Map<string, { data: ProjectSummary[]; ts: number }>()
2238
2239function cacheKey(dateRange?: DateRange, providerFilter?: string): string {
2240 const s = dateRange ? `${dateRange.start.getTime()}:${dateRange.end.getTime()}` : 'none'
2241 // Include the Claude config-dir env so a config change in a long-lived
2242 // process (menubar / GNOME extension / test workers) does not return
2243 // stale data keyed under a previous configuration.
2244 const claudeEnv = (process.env['CLAUDE_CONFIG_DIRS'] ?? '') + '|' + (process.env['CLAUDE_CONFIG_DIR'] ?? '')
2245 // Proxy attribution (totalProxiedCostUSD) is computed live from proxyPaths and
2246 // then cached, so the key must change when that config changes.
2247 return `${s}:${providerFilter ?? 'all'}:${claudeEnv}:${getProxyPathsConfigHash()}`
2248}
2249
2250export function clearSessionCache(): void {
2251 sessionCache.clear()

Callers 1

parseAllSessionsFunction · 0.70

Calls 1

getProxyPathsConfigHashFunction · 0.85

Tested by

no test coverage detected