From 92bbd1b081a2c063dadb56852d3d3fbf762bc16d Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 25 Sep 2022 15:16:48 +0200 Subject: [PATCH] testing without size calculation --- backend/src/utils/auth.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/utils/auth.ts b/backend/src/utils/auth.ts index 7f9fcc933..4d6bd67fa 100644 --- a/backend/src/utils/auth.ts +++ b/backend/src/utils/auth.ts @@ -5,21 +5,21 @@ import LRUCache from "lru-cache"; import { recordTokenCacheAccess, setTokenCacheLength, - setTokenCacheSize, + // setTokenCacheSize, } from "./prometheus"; const tokenCache = new LRUCache({ max: 20000, - maxSize: 20000000, // 20MB - sizeCalculation: (token, key): number => - JSON.stringify(token).length + key.length, //sizeInBytes + // maxSize: 20000000, // 20MB + // sizeCalculation: (token, key): number => + // JSON.stringify(token).length + key.length, //sizeInBytes }); const TOKEN_CACHE_BUFFER = 1000 * 60 * 5; // 5 minutes export async function verifyIdToken(idToken: string): Promise { setTokenCacheLength(tokenCache.size); - setTokenCacheSize(tokenCache.calculatedSize ?? 0); + // setTokenCacheSize(tokenCache.calculatedSize ?? 0); const cached = tokenCache.get(idToken);