Sync with upstream

This commit is contained in:
Gabisonfire
2024-01-31 19:53:47 -05:00
7 changed files with 38 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ const RESOLVED_URL_KEY_PREFIX = `${GLOBAL_KEY_PREFIX}|resolved`;
const STREAM_TTL = process.env.STREAM_TTL || 24 * 60 * 60; // 24 hours
const STREAM_EMPTY_TTL = process.env.STREAM_EMPTY_TTL || 60; // 1 minute
const RESOLVED_URL_TTL = 3 * 60 * 60; // 3 hours
const AVAILABILITY_TTL = 8 * 60 * 60; // 8 hours
const AVAILABILITY_EMPTY_TTL = 30 * 60; // 30 minutes
const MESSAGE_VIDEO_URL_TTL = 60; // 1 minutes
@@ -30,7 +31,7 @@ function initiateRemoteCache() {
options: {
collection: 'torrentio_addon_collection',
socketTimeoutMS: 30000,
poolSize: 150,
poolSize: 200,
useNewUrlParser: true,
useUnifiedTopology: false,
ttl: STREAM_EMPTY_TTL
@@ -68,8 +69,8 @@ export function cacheWrapStream(id, method) {
}
export function cacheWrapResolvedUrl(id, method) {
return cacheWrap(memoryCache, `${RESOLVED_URL_KEY_PREFIX}:${id}`, method, {
ttl: (url) => isStaticUrl(url) ? MESSAGE_VIDEO_URL_TTL : STREAM_TTL
return cacheWrap(remoteCache, `${RESOLVED_URL_KEY_PREFIX}:${id}`, method, {
ttl: (url) => isStaticUrl(url) ? MESSAGE_VIDEO_URL_TTL : RESOLVED_URL_TTL
});
}

View File

@@ -3,7 +3,7 @@ const Op = Sequelize.Op;
const DATABASE_URI = process.env.DATABASE_URI;
const database = new Sequelize(DATABASE_URI, { logging: false, pool: { max: 50, min: 5, idle: 60 * 60 * 1000 } });
const database = new Sequelize(DATABASE_URI, { logging: false, pool: { max: 30, min: 5, idle: 20 * 60 * 1000 } });
const Torrent = database.define('torrent',
{