fine tune mongo connection config
Some checks are pending
Deploy Addon / build (SSH_HOST, SSH_KEY) (push) Waiting to run
Deploy Addon / build (SSH_HOST_2, SSH_KEY_2) (push) Waiting to run
Deploy Addon / build (SSH_HOST_4, SSH_KEY_4) (push) Waiting to run

This commit is contained in:
TheBeastLT 2024-11-17 12:53:37 +02:00
parent a2c126e072
commit 87939e490b

View file

@ -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) {