diff --git a/resolvers/load.py b/resolvers/load.py index 6f277bf..00cf9e2 100644 --- a/resolvers/load.py +++ b/resolvers/load.py @@ -55,7 +55,14 @@ async def load_chats(_, info, limit: int = 50, offset: int = 0): cids.append(r["chat"]["id"]) for cid in cids: - c = await redis.execute("GET", f"chats/{cid}") + # Start a transaction + tr = redis.multi_exec() + # Add the GET command to the transaction + fut = tr.get(f"chats/{cid}") + # Execute the transaction + await tr.execute() + # Get the result of the GET command + c = await fut print(f"got chat {c}") if c: c = json.loads(c)