diff --git a/app/api/courrier/route.ts b/app/api/courrier/route.ts index e175a5fe..802e8d56 100644 --- a/app/api/courrier/route.ts +++ b/app/api/courrier/route.ts @@ -3,7 +3,7 @@ import { ImapFlow } from 'imapflow'; import { getServerSession } from 'next-auth'; import { authOptions } from '@/app/api/auth/[...nextauth]/route'; import { prisma } from '@/lib/prisma'; -import LRU from 'lru-cache'; +import { LRUCache } from 'lru-cache'; // Define types interface Email { @@ -22,7 +22,7 @@ interface Email { } // Configure efficient caching with TTL -const emailCache = new LRU({ +const emailCache = new LRUCache({ max: 500, // Store up to 500 emails ttl: 1000 * 60 * 5, // Cache for 5 minutes });