Skip to content

Commit

Permalink
fix: lower caching ttls
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah authored Aug 19, 2024
1 parent a199c55 commit 13e143a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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];
}

Expand Down

0 comments on commit 13e143a

Please sign in to comment.