()
| 46 | * refreshOverageCreditGrantCache fires lazily to populate it. |
| 47 | */ |
| 48 | export function getCachedOverageCreditGrant(): OverageCreditGrantInfo | null { |
| 49 | const orgId = getOauthAccountInfo()?.organizationUuid |
| 50 | if (!orgId) return null |
| 51 | const cached = getGlobalConfig().overageCreditGrantCache?.[orgId] |
| 52 | if (!cached) return null |
| 53 | if (Date.now() - cached.timestamp > CACHE_TTL_MS) return null |
| 54 | return cached.info |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Drop the current org's cached entry so the next read refetches. |
no test coverage detected