MCPcopy Create free account
hub / github.com/KartikLabhshetwar/foliox / cleanupExpiredCache

Function cleanupExpiredCache

lib/utils/cache.ts:13–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11}
12
13async function cleanupExpiredCache() {
14 try {
15 await prisma.cache.deleteMany({
16 where: {
17 expiresAt: {
18 lt: new Date(),
19 },
20 },
21 });
22 } catch (error) {
23 console.error('Failed to cleanup expired cache:', error);
24 }
25}
26
27export async function getCache<T>(key: string): Promise<T | null> {
28 if (!Settings.CACHE_ENABLED) {

Callers 1

setCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected