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

Function startBackgroundPolling

src/services/policyLimits/index.ts:635–653  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

633 * Start background polling for policy limits
634 */
635export function startBackgroundPolling(): void {
636 if (pollingIntervalId !== null) {
637 return
638 }
639
640 if (!isPolicyLimitsEligible()) {
641 return
642 }
643
644 pollingIntervalId = setInterval(() => {
645 void pollPolicyLimits()
646 }, POLLING_INTERVAL_MS)
647 pollingIntervalId.unref()
648
649 if (!cleanupRegistered) {
650 cleanupRegistered = true
651 registerCleanup(async () => stopBackgroundPolling())
652 }
653}
654
655/**
656 * Stop background polling for policy limits

Callers 1

loadPolicyLimitsFunction · 0.70

Calls 4

isPolicyLimitsEligibleFunction · 0.85
pollPolicyLimitsFunction · 0.85
registerCleanupFunction · 0.85
stopBackgroundPollingFunction · 0.70

Tested by

no test coverage detected