courrier multi account restore compose
This commit is contained in:
parent
d6728947c6
commit
795a9f4629
@ -275,13 +275,9 @@ export async function getEmails(
|
|||||||
console.log(`Fetching emails for user ${userId}${accountId ? ` account ${accountId}` : ''} in folder ${folder}`);
|
console.log(`Fetching emails for user ${userId}${accountId ? ` account ${accountId}` : ''} in folder ${folder}`);
|
||||||
|
|
||||||
// Try to get from cache first
|
// Try to get from cache first
|
||||||
const cacheKey = accountId
|
|
||||||
? `email:list:${userId}:${accountId}:${folder}:${page}:${perPage}:${searchQuery}`
|
|
||||||
: `email:list:${userId}:${folder}:${page}:${perPage}:${searchQuery}`;
|
|
||||||
|
|
||||||
const cached = await getCachedEmailList(userId, accountId || 'default', folder, page, perPage);
|
const cached = await getCachedEmailList(userId, accountId || 'default', folder, page, perPage);
|
||||||
if (cached) {
|
if (cached) {
|
||||||
console.log(`Using cached email list for ${cacheKey}`);
|
console.log(`Using cached email list for ${userId}${accountId ? ` account ${accountId}` : ''} in folder ${folder}`);
|
||||||
return cached;
|
return cached;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +352,7 @@ export async function getEmails(
|
|||||||
mailboxes: await getMailboxes(client)
|
mailboxes: await getMailboxes(client)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Cache the result
|
// Cache the result with the correct accountId
|
||||||
await cacheEmailList(userId, accountId || 'default', folder, page, perPage, result);
|
await cacheEmailList(userId, accountId || 'default', folder, page, perPage, result);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user