diff options
author | mat <github@matdoes.dev> | 2021-05-31 19:21:55 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2021-05-31 19:23:00 -0500 |
commit | eff9086ba4e19fc97965cc84fdf1564375bb322e (patch) | |
tree | 1772e9e795b2dfaec4f9ae74f8e2cddd3ce70958 | |
parent | fe3cc50df92d34ecf219bb7fbbbd8f3b60bf0fff (diff) | |
download | skyblock-api-eff9086ba4e19fc97965cc84fdf1564375bb322e.tar.gz skyblock-api-eff9086ba4e19fc97965cc84fdf1564375bb322e.tar.bz2 skyblock-api-eff9086ba4e19fc97965cc84fdf1564375bb322e.zip |
change cache time for usernames
-rw-r--r-- | build/hypixelCached.js | 7 | ||||
-rw-r--r-- | src/hypixelCached.ts | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/build/hypixelCached.js b/build/hypixelCached.js index 29c0e6a..9b753e7 100644 --- a/build/hypixelCached.js +++ b/build/hypixelCached.js @@ -32,10 +32,11 @@ const mojang = __importStar(require("./mojang")); const hypixel = __importStar(require("./hypixel")); const util_1 = require("./util"); const _1 = require("."); -// cache usernames for 4 hours +// cache usernames for 30 minutes /** uuid: username */ exports.usernameCache = new node_cache_1.default({ - stdTTL: 60 * 60 * 4, + // stdTTL: 60 * 60 * 4, + stdTTL: 60 * 30, checkperiod: 60, useClones: false, }); @@ -52,7 +53,7 @@ exports.playerCache = new node_cache_1.default({ }); // cache "basic players" (players without profiles) for 30 minutes exports.basicPlayerCache = new lru_cache_1.default({ - max: 20000, + max: 10000, maxAge: 60 * 30, }); exports.profileCache = new node_cache_1.default({ diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index aab5407..4ffd1a7 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -11,11 +11,12 @@ import { isUuid, undashUuid } from './util' import { CleanProfile, CleanFullProfile, CleanBasicProfile } from './cleaners/skyblock/profile' import { debug } from '.' -// cache usernames for 4 hours +// cache usernames for 30 minutes /** uuid: username */ export const usernameCache = new NodeCache({ - stdTTL: 60 * 60 * 4, + // stdTTL: 60 * 60 * 4, + stdTTL: 60 * 30, checkperiod: 60, useClones: false, }) @@ -36,7 +37,7 @@ export const playerCache = new NodeCache({ // cache "basic players" (players without profiles) for 30 minutes export const basicPlayerCache: LRUCache<string, CleanPlayer> = new LRUCache({ - max: 20000, + max: 10000, maxAge: 60 * 30, }) |