re-enable cache

This commit is contained in:
TheBeastLT
2023-02-26 10:50:49 +01:00
parent bd00282e64
commit 78770dc14c
2 changed files with 4 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ const MONGO_URI = process.env.MONGODB_URI;
const NO_CACHE = process.env.NO_CACHE || false;
const memoryCache = initiateMemoryCache();
// const remoteCache = initiateRemoteCache();
const remoteCache = initiateRemoteCache();
function initiateRemoteCache() {
if (NO_CACHE) {
@@ -62,7 +62,7 @@ function cacheWrap(cache, key, method, options) {
}
function cacheWrapStream(id, method) {
return cacheWrap(memoryCache, `${STREAM_KEY_PREFIX}:${id}`, method, {
return cacheWrap(remoteCache, `${STREAM_KEY_PREFIX}:${id}`, method, {
ttl: (streams) => streams.length ? STREAM_TTL : STREAM_EMPTY_TTL
});
}