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

Function getFromCache

clean_member/clean_member.ts:64–72  ·  view source on GitHub ↗
(chatId: number, mode: string, day: number)

Source from the content-addressed store, hash-verified

62 const cached = cache.get(key);
63 if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
64 return cached.data;
65 }
66 cache.delete(key);
67 return null;
68}
69
70function setCache(chatId: number, mode: string, day: number, data: CacheData): void {
71 const key = getCacheKey(chatId, mode, day);
72 cache.set(key, { data, timestamp: Date.now() });
73 trimCache();
74}
75

Callers 1

checkCacheFunction · 0.85

Calls 3

getCacheKeyFunction · 0.85
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected