This commit is contained in:
Untone 2023-10-13 02:54:11 +03:00
parent 3b5836a4f2
commit b0de5e5596

View File

@ -55,7 +55,14 @@ async def load_chats(_, info, limit: int = 50, offset: int = 0):
cids.append(r["chat"]["id"]) cids.append(r["chat"]["id"])
for cid in cids: 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}") print(f"got chat {c}")
if c: if c:
c = json.loads(c) c = json.loads(c)