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

Function calculateApiKeyHelperTTL

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

Source from the content-addressed store, hash-verified

507 * otherwise defaults to 5 minutes
508 */
509export function calculateApiKeyHelperTTL(): number {
510 const envTtl = process.env.CLAUDE_CODE_API_KEY_HELPER_TTL_MS
511
512 if (envTtl) {
513 const parsed = parseInt(envTtl, 10)
514 if (!Number.isNaN(parsed) && parsed >= 0) {
515 return parsed
516 }
517 logForDebugging(
518 `Found CLAUDE_CODE_API_KEY_HELPER_TTL_MS env var, but it was not a valid number. Got ${envTtl}`,
519 { level: 'error' },
520 )
521 }
522
523 return DEFAULT_API_KEY_HELPER_TTL
524}
525
526// Async API key helper with sync cache for non-blocking reads.
527// Epoch bumps on clearApiKeyHelperCache() — orphaned executions check their

Callers 1

Calls 1

logForDebuggingFunction · 0.70

Tested by

no test coverage detected