diff options
author | mat <github@matdoes.dev> | 2021-05-27 19:35:10 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2021-05-27 19:35:10 -0500 |
commit | 735e506b8da1c8461380a409492032752d3f9edf (patch) | |
tree | 99d799556fd40d771339d91a5766b907a4a63a20 /build | |
parent | 32cd759204c2de2f9b8b81fe001e20910db6fe9d (diff) | |
download | skyblock-api-735e506b8da1c8461380a409492032752d3f9edf.tar.gz skyblock-api-735e506b8da1c8461380a409492032752d3f9edf.tar.bz2 skyblock-api-735e506b8da1c8461380a409492032752d3f9edf.zip |
increase max in basicPlayerCache hopefully it doesn't use too much ram
Diffstat (limited to 'build')
-rw-r--r-- | build/hypixelCached.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/build/hypixelCached.js b/build/hypixelCached.js index 8c5fa3c..b36fd8d 100644 --- a/build/hypixelCached.js +++ b/build/hypixelCached.js @@ -51,7 +51,7 @@ exports.playerCache = new node_cache_1.default({ }); // cache "basic players" (players without profiles) for 4 hours exports.basicPlayerCache = new lru_cache_1.default({ - max: 10000, + max: 20000, maxAge: 60 * 60 * 4 * 1000, }); exports.profileCache = new node_cache_1.default({ @@ -93,7 +93,7 @@ async function uuidFromUser(user) { const username = exports.usernameCache.get(util_1.undashUuid(user)); // sometimes the username will be null, return that if (username === null) - return username; + return null; // if it has .then, then that means its a waitForCacheSet promise. This is done to prevent requests made while it is already requesting if (username.then) { const { key: uuid, value: _username } = await username; @@ -232,7 +232,7 @@ async function fetchBasicProfiles(user) { console.debug('Cache miss: fetchBasicProfiles', user); const player = await fetchPlayer(playerUuid); if (!player) { - console.log('bruh playerUuid', playerUuid); + console.log('bruh playerUuid', user, playerUuid); return []; } const profiles = player.profiles; |