MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / loadFromStore

Function loadFromStore

apps/cloud/src/auth/jwks-cache.ts:319–335  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

317 };
318
319 const loadFromStore = async (): Promise<CacheEntry | null> => {
320 if (!store) return null;
321 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: the L2 store is an optimization; any failure degrades to an upstream fetch
322 try {
323 const storeReadStartedAt = Date.now();
324 const stored = await store.get(url);
325 lastStoreReadMs = Date.now() - storeReadStartedAt;
326 if (!stored) return null;
327 const candidate = entryFrom(stored);
328 if (!isUsable(candidate)) return null;
329 entry = candidate;
330 storeHitCount += 1;
331 return candidate;
332 } catch {
333 return null;
334 }
335 };
336
337 /** A refresh the caller waits on — the only kind that costs it latency. */
338 const refreshBlocking = (): Promise<CacheEntry> => {

Callers 1

ensureFreshFunction · 0.85

Calls 3

entryFromFunction · 0.85
isUsableFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected