updates addon cache times

This commit is contained in:
TheBeastLT
2020-03-11 19:12:22 +01:00
parent 2acc9a7f2d
commit c8e2138856
2 changed files with 5 additions and 5 deletions

View File

@@ -4,10 +4,10 @@ const { toStreamInfo } = require('./lib/streamInfo');
const { cacheWrapStream } = require('./lib/cache');
const repository = require('./lib/repository');
const CACHE_MAX_AGE = process.env.CACHE_MAX_AGE || 24 * 60; // 24 hours in seconds
const CACHE_MAX_AGE_EMPTY = 4 * 60; // 4 hours in seconds
const STALE_REVALIDATE_AGE = 4 * 60; // 4 hours
const STALE_ERROR_AGE = 7 * 24 * 60; // 7 days
const CACHE_MAX_AGE = process.env.CACHE_MAX_AGE || 4 * 60 * 60; // 4 hours in seconds
const CACHE_MAX_AGE_EMPTY = 30 * 60; // 30 minutes
const STALE_REVALIDATE_AGE = 4 * 60 * 60; // 4 hours
const STALE_ERROR_AGE = 7 * 24 * 60 * 60; // 7 days
const builder = new addonBuilder({
id: 'com.stremio.torrentio.addon',

View File

@@ -4,7 +4,7 @@ const mangodbStore = require('cache-manager-mongodb');
const GLOBAL_KEY_PREFIX = 'torrentio-addon';
const STREAM_KEY_PREFIX = `${GLOBAL_KEY_PREFIX}|stream`;
const STREAM_TTL = process.env.STREAM_TTL || 24 * 60 * 60; // 24 hours
const STREAM_TTL = process.env.STREAM_TTL || 4 * 60 * 60; // 4 hours
const STREAM_EMPTY_TTL = process.env.STREAM_EMPTY_TTL || 30 * 60; // 30 minutes
// When the streams are empty we want to cache it for less time in case of timeouts or failures