From a71cf3e9fc4e7aca0376764fbc53070fdee33587 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Thu, 17 Nov 2022 23:29:04 +0300 Subject: [PATCH] search-fix --- services/search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/search.py b/services/search.py index f599a1d1..88af35ff 100644 --- a/services/search.py +++ b/services/search.py @@ -17,7 +17,7 @@ class SearchService: @staticmethod async def search(text, limit, offset) -> [Shout]: - cached = redis.execute("GET", text) + cached = await redis.execute("GET", text) if not cached: async with SearchService.lock: by = { @@ -25,7 +25,7 @@ class SearchService: "body": text } payload = await load_shouts_by(None, None, by, limit, offset) - redis.execute("SET", text, json.dumps(payload)) + await redis.execute("SET", text, json.dumps(payload)) return payload else: return json.loads(cached)