Skip to content

Commit

Permalink
undo test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arcoraven committed Oct 18, 2024
1 parent 29df81b commit eb7805a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/utils/cache/accessToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import LRUMap from "mnemonist/lru-map";
import { getToken } from "../../db/tokens/getToken";

// Cache an access token JWT to the token object, or null if not found.
export const accessTokenCache = new LRUMap<string, Tokens | null>(1);
export const accessTokenCache = new LRUMap<string, Tokens | null>(2048);

interface GetAccessTokenParams {
jwt: string;
Expand All @@ -14,11 +14,9 @@ export const getAccessToken = async ({
}: GetAccessTokenParams): Promise<Tokens | null> => {
const cached = accessTokenCache.get(jwt);
if (cached) {
console.log("[DEBUG] found access token in cache");
return cached;
}

console.log("[DEBUG] access token not in cache");
const accessToken = await getToken(jwt);
accessTokenCache.set(jwt, accessToken);
return accessToken;
Expand Down

0 comments on commit eb7805a

Please sign in to comment.