From 13e143a666bc0ba7ac4defa51908f10416808e33 Mon Sep 17 00:00:00 2001 From: Snazzah <7025343+Snazzah@users.noreply.github.com> Date: Mon, 19 Aug 2024 08:45:02 -0500 Subject: [PATCH] fix: lower caching ttls --- src/util/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/api.ts b/src/util/api.ts index aff3c1d..c210f55 100644 --- a/src/util/api.ts +++ b/src/util/api.ts @@ -24,7 +24,7 @@ export class TrelloAPIError extends Error { } } -async function recacheKey(key: string, data: any, defaultTtl = 10 * 60) { +async function recacheKey(key: string, data: any, defaultTtl = 2 * 60) { const ttl = await client.ttl(key); await client.set(key, JSON.stringify(data), 'EX', ttl || defaultTtl); } @@ -128,8 +128,8 @@ export async function getBoard(token: string, id: string, memberId: string, requ cards: subscribedCards }; - await client.set(key, JSON.stringify(response.data), 'EX', 10 * 60); - await client.set(subsKey, JSON.stringify(subscriptions), 'EX', 20 * 60); + await client.set(key, JSON.stringify(response.data), 'EX', 30); + await client.set(subsKey, JSON.stringify(subscriptions), 'EX', 60); return [response.data, subscriptions]; }