panel 2 courier api

This commit is contained in:
alma 2025-04-25 12:48:29 +02:00
parent bd809be84f
commit f6c4c77993

View File

@ -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<string, Email>({
const emailCache = new LRUCache<string, Email>({
max: 500, // Store up to 500 emails
ttl: 1000 * 60 * 5, // Cache for 5 minutes
});