diff options
author | mat <github@matdoes.dev> | 2021-05-25 22:40:59 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2021-05-25 22:40:59 -0500 |
commit | 9c49c30b09cbd8a1eb407f96a7ee2be0c4429257 (patch) | |
tree | 221fe154d6a56c6565bc6275ba8d6ab143a9893e /build/hypixelCached.js | |
parent | b71732cb773c42cf690ec0f1999af750d2975603 (diff) | |
download | skyblock-api-9c49c30b09cbd8a1eb407f96a7ee2be0c4429257.tar.gz skyblock-api-9c49c30b09cbd8a1eb407f96a7ee2be0c4429257.tar.bz2 skyblock-api-9c49c30b09cbd8a1eb407f96a7ee2be0c4429257.zip |
add LRUCache for basicPlayerCache
Diffstat (limited to 'build/hypixelCached.js')
-rw-r--r-- | build/hypixelCached.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/build/hypixelCached.js b/build/hypixelCached.js index 626aaed..702a23e 100644 --- a/build/hypixelCached.js +++ b/build/hypixelCached.js @@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchProfileName = exports.fetchBasicProfileFromUuid = exports.fetchProfile = exports.fetchProfileUuid = exports.fetchSkyblockProfiles = exports.fetchBasicPlayer = exports.fetchPlayer = exports.usernameFromUser = exports.uuidFromUser = exports.profileNameCache = exports.profilesCache = exports.profileCache = exports.basicPlayerCache = exports.playerCache = exports.basicProfilesCache = exports.usernameCache = void 0; const node_cache_1 = __importDefault(require("node-cache")); +const lru_cache_1 = __importDefault(require("lru-cache")); const mojang = __importStar(require("./mojang")); const hypixel = __importStar(require("./hypixel")); const util_1 = require("./util"); @@ -49,10 +50,9 @@ exports.playerCache = new node_cache_1.default({ useClones: true, }); // cache "basic players" (players without profiles) for 4 hours -exports.basicPlayerCache = new node_cache_1.default({ - stdTTL: 60 * 60 * 4, - checkperiod: 60 * 10, - useClones: true +exports.basicPlayerCache = new lru_cache_1.default({ + max: 10000, + maxAge: 60 * 60 * 4 * 1000, }); exports.profileCache = new node_cache_1.default({ stdTTL: 30, |