From 83294ec6f4f3ed4d113068307dc935717f80546d Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Thu, 31 Oct 2024 03:12:10 +0100 Subject: [PATCH] Replaced argv dependency with options argument. --- geo.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geo.mjs b/geo.mjs index 9610551..af36bf8 100644 --- a/geo.mjs +++ b/geo.mjs @@ -1,4 +1,4 @@ -export async function resolvePlace(query, context) { +export async function resolvePlace(query, context, options = {}) { if (!query) { return null; } @@ -6,7 +6,7 @@ export async function resolvePlace(query, context) { const cacheKey = `place-${context.slugify(query)}`; const cachedPlace = await context.redis.hGetAll(cacheKey); - if (context.argv.placeCache !== false && await context.redis.exists(cacheKey)) { + if (options.useCache !== false && await context.redis.exists(cacheKey)) { await context.redis.expire(cacheKey, 3600 * 24 * 30); context.logger.debug(`Using cached place '${cacheKey}' for query '${query}': ${JSON.stringify(cachedPlace)}`);