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

Function readUpdateCheckCache

src/upgrade/update-check.ts:97–106  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

95}
96
97export function readUpdateCheckCache(dir: string): UpdateCheckCacheFile | null {
98 try {
99 const raw = fs.readFileSync(updateCheckCachePath(dir), 'utf8');
100 const parsed = JSON.parse(raw) as UpdateCheckCacheFile;
101 if (typeof parsed?.lastAttemptAt !== 'number') return null;
102 return parsed;
103 } catch {
104 return null; // missing / torn / unparseable — same as no cache
105 }
106}
107
108function writeUpdateCheckCache(dir: string, cache: UpdateCheckCacheFile): void {
109 try {

Callers 3

refreshUpdateCheckFunction · 0.85
getUpdateNoticeFunction · 0.85

Calls 1

updateCheckCachePathFunction · 0.85

Tested by

no test coverage detected