MCPcopy Create free account
hub / github.com/VPSDance/ai-proxy-rules / statCacheFile

Function statCacheFile

scripts/status.ts:101–110  ·  view source on GitHub ↗
(cacheDir: string, key: string)

Source from the content-addressed store, hash-verified

99
100 await writeFile(options.output, renderMarkdown(rows), "utf8");
101 console.log(`[status] wrote ${options.output} (${rows.length} providers)`);
102}
103
104async function statCacheFile(cacheDir: string, key: string): Promise<{ mtime: Date } | null> {
105 const hash = createHash("sha256").update(key).digest("hex").slice(0, 16);
106 const file = path.join(cacheDir, `${hash}.txt`);
107 try {
108 const stats = await stat(file);
109 return { mtime: stats.mtime };
110 } catch {
111 return null;
112 }
113}

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected