diff options
author | mat <github@matdoes.dev> | 2021-09-11 17:54:50 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2021-09-11 17:54:50 -0500 |
commit | ae0b779e5c3bac40ec22149d20c2f8465b07a9b9 (patch) | |
tree | e05ced0e6e213221e5036bd74f02316153eafce1 | |
parent | 55b38f160d382333235437a2858d2d90ee0d81a8 (diff) | |
download | skyblock-api-ae0b779e5c3bac40ec22149d20c2f8465b07a9b9.tar.gz skyblock-api-ae0b779e5c3bac40ec22149d20c2f8465b07a9b9.tar.bz2 skyblock-api-ae0b779e5c3bac40ec22149d20c2f8465b07a9b9.zip |
increase max listeners for TLSSocket
-rw-r--r-- | build/hypixelCached.js | 3 | ||||
-rw-r--r-- | src/hypixelCached.ts | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/build/hypixelCached.js b/build/hypixelCached.js index 69bcc62..56671ab 100644 --- a/build/hypixelCached.js +++ b/build/hypixelCached.js @@ -7,6 +7,7 @@ import * as mojang from './mojang.js'; import NodeCache from 'node-cache'; import { debug } from './index.js'; import LRUCache from 'lru-cache'; +import { TLSSocket } from 'tls'; // cache usernames for 30 minutes /** uuid: username */ export const usernameCache = new NodeCache({ @@ -16,6 +17,8 @@ export const usernameCache = new NodeCache({ useClones: false, }); usernameCache.setMaxListeners(50); +// @ts-ignore for some reason the typings don't have setMaxListeners but it does +TLSSocket.setMaxListeners(50); export const basicProfilesCache = new NodeCache({ stdTTL: 60 * 10, checkperiod: 60, diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts index 73e75aa..07566f9 100644 --- a/src/hypixelCached.ts +++ b/src/hypixelCached.ts @@ -10,6 +10,7 @@ import * as mojang from './mojang.js' import NodeCache from 'node-cache' import { debug } from './index.js' import LRUCache from 'lru-cache' +import { TLSSocket } from 'tls' // cache usernames for 30 minutes /** uuid: username */ @@ -22,6 +23,9 @@ export const usernameCache = new NodeCache({ }) usernameCache.setMaxListeners(50) +// @ts-ignore for some reason the typings don't have setMaxListeners but it does +TLSSocket.setMaxListeners(50) + export const basicProfilesCache = new NodeCache({ stdTTL: 60 * 10, |