MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / cacheIsFresh

Function cacheIsFresh

src/upgrade/update-check.ts:155–162  ·  view source on GitHub ↗
(cache: UpdateCheckCacheFile | null, nowMs: number)

Source from the content-addressed store, hash-verified

153}
154
155function cacheIsFresh(cache: UpdateCheckCacheFile | null, nowMs: number): boolean {
156 if (!cache) return false;
157 if (cache.lastSuccessAt !== undefined && nowMs - cache.lastSuccessAt < UPDATE_CHECK_TTL_MS) {
158 return true;
159 }
160 // No recent success: only the failure backoff holds the network call off.
161 return nowMs - cache.lastAttemptAt < UPDATE_CHECK_FAILURE_BACKOFF_MS;
162}
163
164/**
165 * Ensure the on-disk cache is fresh (hitting the network only past the TTL /

Callers 2

refreshUpdateCheckFunction · 0.85
getUpdateNoticeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected