MCPcopy Create free account
hub / github.com/monkeytypegame/monkeytype / getCachedConfiguration

Function getCachedConfiguration

backend/src/init/configuration.ts:58–70  ·  view source on GitHub ↗
(
  attemptCacheUpdate = false,
)

Source from the content-addressed store, hash-verified

56let serverConfigurationUpdated = false;
57
58export 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
72export async function getLiveConfiguration(): Promise<Configuration> {
73 lastFetchTime = Date.now();

Callers 9

deleteOldLogsFunction · 0.90
updateLeaderboardsFunction · 0.90
contextMiddlewareFunction · 0.90
addResultFunction · 0.90
checkIfUserIsPremiumFunction · 0.90
updateFunction · 0.90
auth.spec.tsFile · 0.90

Calls 1

getLiveConfigurationFunction · 0.85

Tested by

no test coverage detected