MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / readCache

Function readCache

out/cli.cjs:86192–86202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86190init_dist2();
86191
86192// src/utils/modelCache.ts
86193var import_fs5 = require("fs");
86194var import_os2 = require("os");
86195var import_path6 = require("path");
86196var MODEL_CACHE_PATH = (0, import_path6.join)((0, import_os2.homedir)(), ".opencommit-models.json");
86197var CACHE_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
86198function readCache() {
86199 try {
86200 if (!(0, import_fs5.existsSync)(MODEL_CACHE_PATH)) {
86201 return null;
86202 }
86203 const data = (0, import_fs5.readFileSync)(MODEL_CACHE_PATH, "utf8");
86204 return JSON.parse(data);
86205 } catch {

Callers 3

fetchModelsForProviderFunction · 0.70
getCacheInfoFunction · 0.70
getCachedModelsFunction · 0.70

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…