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

Function pollRemoteSettings

src/services/remoteManagedSettings/index.ts:584–606  ·  view source on GitHub ↗

* Background polling callback - fetches settings and triggers hot-reload if changed

()

Source from the content-addressed store, hash-verified

582 * Background polling callback - fetches settings and triggers hot-reload if changed
583 */
584async function pollRemoteSettings(): Promise<void> {
585 if (!isRemoteManagedSettingsEligible()) {
586 return
587 }
588
589 // Get current cached settings for comparison
590 const prevCache = getRemoteManagedSettingsSyncFromCache()
591 const previousSettings = prevCache ? jsonStringify(prevCache) : null
592
593 try {
594 await fetchAndLoadRemoteManagedSettings()
595
596 // Check if settings actually changed
597 const newCache = getRemoteManagedSettingsSyncFromCache()
598 const newSettings = newCache ? jsonStringify(newCache) : null
599 if (newSettings !== previousSettings) {
600 logForDebugging('Remote settings: Changed during background poll')
601 settingsChangeDetector.notifyChange('policySettings')
602 }
603 } catch {
604 // Don't fail closed for background polling - just continue
605 }
606}
607
608/**
609 * Start background polling for remote settings

Callers 1

startBackgroundPollingFunction · 0.85

Calls 5

jsonStringifyFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected