MCPcopy Create free account
hub / github.com/codeaashu/claude-code / pollPolicyLimits

Function pollPolicyLimits

src/services/policyLimits/index.ts:613–630  ·  view source on GitHub ↗

* Background polling callback

()

Source from the content-addressed store, hash-verified

611 * Background polling callback
612 */
613async function pollPolicyLimits(): Promise<void> {
614 if (!isPolicyLimitsEligible()) {
615 return
616 }
617
618 const previousCache = sessionCache ? jsonStringify(sessionCache) : null
619
620 try {
621 await fetchAndLoadPolicyLimits()
622
623 const newCache = sessionCache ? jsonStringify(sessionCache) : null
624 if (newCache !== previousCache) {
625 logForDebugging('Policy limits: Changed during background poll')
626 }
627 } catch {
628 // Don't fail closed for background polling
629 }
630}
631
632/**
633 * Start background polling for policy limits

Callers 1

startBackgroundPollingFunction · 0.85

Calls 4

isPolicyLimitsEligibleFunction · 0.85
jsonStringifyFunction · 0.85
fetchAndLoadPolicyLimitsFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected