MCPcopy Create free account
hub / github.com/freecodexyz/free-code / calculateApiKeyHelperTTL

Function calculateApiKeyHelperTTL

src/utils/auth.ts:436–451  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

434 * otherwise defaults to 5 minutes
435 */
436export function calculateApiKeyHelperTTL(): number {
437 const envTtl = process.env.CLAUDE_CODE_API_KEY_HELPER_TTL_MS
438
439 if (envTtl) {
440 const parsed = parseInt(envTtl, 10)
441 if (!Number.isNaN(parsed) && parsed >= 0) {
442 return parsed
443 }
444 logForDebugging(
445 `Found CLAUDE_CODE_API_KEY_HELPER_TTL_MS env var, but it was not a valid number. Got ${envTtl}`,
446 { level: 'error' },
447 )
448 }
449
450 return DEFAULT_API_KEY_HELPER_TTL
451}
452
453// Async API key helper with sync cache for non-blocking reads.
454// Epoch bumps on clearApiKeyHelperCache() — orphaned executions check their

Callers 1

Calls 1

logForDebuggingFunction · 0.85

Tested by

no test coverage detected