* Background polling callback
()
| 611 | * Background polling callback |
| 612 | */ |
| 613 | async 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 |
no test coverage detected