MCPcopy Create free account
hub / github.com/MathMan05/Fermi / loadUptimeObject

Function loadUptimeObject

src/stats.ts:29–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27const uptimeObject: Map<string, UptimeEntry[]> = loadUptimeObject();
28
29function loadUptimeObject(): Map<string, UptimeEntry[]> {
30 const filePath = process.env.JANK_UPTIME_JSON_PATH || path.join(__dirname, "..", "uptime.json");
31 if (fs.existsSync(filePath)) {
32 try {
33 const data = JSON.parse(fs.readFileSync(filePath, "utf8"));
34 return new Map(Object.entries(data));
35 } catch (error) {
36 console.error("Error reading uptime.json:", error);
37 return new Map();
38 }
39 }
40 return new Map();
41}
42
43let saveTimeout: ReturnType<typeof setTimeout> | null = null;
44

Callers 1

stats.tsFile · 0.85

Calls 3

errorMethod · 0.80
joinMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected