From 5b07692e572fe055b6a3d6df54899194ed0a5392 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Fri, 3 Apr 2020 13:27:26 +0200 Subject: [PATCH] [scraper] reduce resolved url cache time --- scraper/lib/cache.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scraper/lib/cache.js b/scraper/lib/cache.js index d2978e7..7fdf5a4 100644 --- a/scraper/lib/cache.js +++ b/scraper/lib/cache.js @@ -11,6 +11,7 @@ const TORRENT_FILES_KEY_PREFIX = `stremio-tpb|files`; const GLOBAL_TTL = process.env.METADATA_TTL || 7 * 24 * 60 * 60; // 7 days const MEMORY_TTL = process.env.METADATA_TTL || 2 * 60 * 60; // 2 hours +const RESOLVED_URL_TTL = 2 * 60; // 2 minutes const PROXY_TTL = 8 * 60 * 60; // 8 hours const MONGO_URI = process.env.MONGODB_URI; @@ -88,7 +89,7 @@ function cacheWrapMetadata(id, method) { } function cacheWrapResolvedUrl(id, method) { - return cacheWrap(memoryCache, `${RESOLVED_URL_KEY_PREFIX}:${id}`, method, { ttl: { MEMORY_TTL } }); + return cacheWrap(memoryCache, `${RESOLVED_URL_KEY_PREFIX}:${id}`, method, { ttl: { RESOLVED_URL_TTL } }); } function cacheWrapProxy(id, method) {