From 5f2c9eb5df4cd387e2735aed24d7b19f61b0bd77 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Thu, 3 Aug 2023 00:31:07 +0200 Subject: [PATCH] Fixed place cache check. --- src/utils/resolve-place.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/resolve-place.js b/src/utils/resolve-place.js index ee788a03..7aa23b64 100755 --- a/src/utils/resolve-place.js +++ b/src/utils/resolve-place.js @@ -17,7 +17,7 @@ async function resolvePlace(query) { const cacheKey = `place-${slugify(query)}`; const cachedPlace = await redis.hGetAll(cacheKey); - if (cachedPlace && argv.placeCache !== false) { + if (argv.placeCache !== false && await redis.exists(cacheKey)) { await redis.expire(cacheKey, 3600 * 24 * 30); logger.debug(`Using cached place '${cacheKey}' for query '${query}': ${JSON.stringify(cachedPlace)}`);