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

Function getStars

apps/marketing/src/lib/github.ts:51–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50/** Live star count, memoized per isolate with a TTL. null when unavailable. */
51export function getStars(): Promise<number | null> {
52 const now = Date.now();
53 if (cached) {
54 const ttl = cached.value != null ? TTL_OK_MS : TTL_FAIL_MS;
55 if (now - cached.at < ttl) return Promise.resolve(cached.value);
56 }
57 if (inflight) return inflight;
58 inflight = fetchStars().then((value) => {
59 cached = { value, at: Date.now() };
60 inflight = null;
61 return value;
62 });
63 return inflight;
64}

Callers

nothing calls this directly

Calls 2

fetchStarsFunction · 0.85
resolveMethod · 0.80

Tested by

no test coverage detected