From 1e1dce1e30386c0fc7208144a20ffbe5f87c865e Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Thu, 16 Sep 2021 15:33:15 -0700 Subject: [PATCH] Fix leftover issues from cache refactor --- hyperglass/api/routes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hyperglass/api/routes.py b/hyperglass/api/routes.py index d059c1b..b8d5a1d 100644 --- a/hyperglass/api/routes.py +++ b/hyperglass/api/routes.py @@ -119,7 +119,7 @@ async def query( log.debug("Query {} exists in cache", cache_key) # If a cached response exists, reset the expiration time. - cache.expire(cache_key, seconds=state.params.cache.timeout) + cache.expire(cache_key, expire_in=state.params.cache.timeout) cached = True runtime = 0 @@ -154,14 +154,14 @@ async def query( raw_output = str(cache_output) cache.set_map_item(cache_key, "output", raw_output) cache.set_map_item(cache_key, "timestamp", timestamp) - cache.expire(cache_key, seconds=state.params.cache.timeout) + cache.expire(cache_key, expire_in=state.params.cache.timeout) log.debug("Added cache entry for query: {}", cache_key) runtime = int(round(elapsedtime, 0)) # If it does, return the cached entry - cache_response = cache.get_dict(cache_key, "output") + cache_response = cache.get_map(cache_key, "output") response_format = "text/plain" if json_output: