( attemptCacheUpdate = false, )
| 56 | let serverConfigurationUpdated = false; |
| 57 | |
| 58 | export async function getCachedConfiguration( |
| 59 | attemptCacheUpdate = false, |
| 60 | ): Promise<Configuration> { |
| 61 | if ( |
| 62 | attemptCacheUpdate && |
| 63 | lastFetchTime < Date.now() - CONFIG_UPDATE_INTERVAL |
| 64 | ) { |
| 65 | Logger.info("Cached configuration is stale."); |
| 66 | return await getLiveConfiguration(); |
| 67 | } |
| 68 | |
| 69 | return configuration; |
| 70 | } |
| 71 | |
| 72 | export async function getLiveConfiguration(): Promise<Configuration> { |
| 73 | lastFetchTime = Date.now(); |
no test coverage detected