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

Function loadPolicyLimits

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

Source from the content-addressed store, hash-verified

554 * Also starts background polling to pick up changes mid-session
555 */
556export async function loadPolicyLimits(): Promise<void> {
557 if (isPolicyLimitsEligible() && !loadingCompletePromise) {
558 loadingCompletePromise = new Promise(resolve => {
559 loadingCompleteResolve = resolve
560 })
561 }
562
563 try {
564 await fetchAndLoadPolicyLimits()
565
566 if (isPolicyLimitsEligible()) {
567 startBackgroundPolling()
568 }
569 } finally {
570 if (loadingCompleteResolve) {
571 loadingCompleteResolve()
572 loadingCompleteResolve = null
573 }
574 }
575}
576
577/**
578 * Refresh policy limits asynchronously (for auth state changes)

Callers 1

runFunction · 0.85

Calls 3

isPolicyLimitsEligibleFunction · 0.85
fetchAndLoadPolicyLimitsFunction · 0.85
startBackgroundPollingFunction · 0.70

Tested by

no test coverage detected