Replaced argv dependency with options argument.
This commit is contained in:
		
							parent
							
								
									4316b69a43
								
							
						
					
					
						commit
						83294ec6f4
					
				
							
								
								
									
										4
									
								
								geo.mjs
								
								
								
								
							
							
						
						
									
										4
									
								
								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)}`); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue