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)}`);