From 87939e490b86b3dcea74a9af04df7a491784e9e4 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Sun, 17 Nov 2024 12:53:37 +0200 Subject: [PATCH] fine tune mongo connection config --- addon/lib/cache.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addon/lib/cache.js b/addon/lib/cache.js index f32acf1..aa6ec64 100644 --- a/addon/lib/cache.js +++ b/addon/lib/cache.js @@ -18,7 +18,12 @@ const MESSAGE_VIDEO_URL_TTL = 60 * 1000; // 1 minutes const MONGO_URI = process.env.MONGODB_URI; const memoryCache = new KeyvCacheableMemory({ ttl: MESSAGE_VIDEO_URL_TTL, lruSize: Infinity }); -const remoteCache = MONGO_URI && new KeyvMongo(MONGO_URI, { collection: 'torrentio_addon_collection' }); +const remoteCache = MONGO_URI && new KeyvMongo(MONGO_URI, { + collection: 'torrentio_addon_collection', + minPoolSize: 50, + maxPoolSize: 200, + maxConnecting: 5, +}); async function cacheWrap(cache, key, method, ttl) { if (!cache) {