MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / getAvgCacheDb

Function getAvgCacheDb

admin_board/admin_board.ts:424–431  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

422 return `${target.storageKey}:${userId}`;
423}
424
425async function getCachedAvgEntry(
426 target: TargetChat,
427 userId: string,
428): Promise<AvgCacheEntry | undefined> {
429 const db = await getAvgCacheDb();
430 const entry = db.data.values[getAvgCacheKey(target, userId)];
431 if (!entry) return undefined;
432 if (Date.now() - entry.updatedAt > DAY_MS) return undefined;
433 return entry;
434}

Callers 3

getCachedAvgEntryFunction · 0.85
setCachedEntryFunction · 0.85
clearAvgCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected