search-fix
This commit is contained in:
parent
9cfad11df2
commit
a71cf3e9fc
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user