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 /src | |
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 'src')
-rw-r--r-- | src/hypixelCached.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index 9bfd97e..6296dba 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -3,6 +3,7 @@ */ import NodeCache from 'node-cache' +import LRUCache from 'lru-cache' import * as mojang from './mojang' import * as hypixel from './hypixel' import { CleanPlayer } from './cleaners/player' @@ -32,10 +33,9 @@ export const playerCache = new NodeCache({ }) // cache "basic players" (players without profiles) for 4 hours -export const basicPlayerCache = new NodeCache({ - stdTTL: 60 * 60 * 4, - checkperiod: 60 * 10, - useClones: true +export const basicPlayerCache: LRUCache<string, CleanPlayer> = new LRUCache({ + max: 10000, + maxAge: 60 * 60 * 4 * 1000, }) export const profileCache = new NodeCache({ |