logs-fixes-debug
Some checks failed
deploy / deploy (push) Failing after 5s

This commit is contained in:
2024-01-23 23:13:49 +03:00
parent 80fed4049a
commit 9b03e625f4
7 changed files with 141 additions and 120 deletions

View File

@@ -27,8 +27,9 @@ async def load_messages(
try:
message_ids = [] + (ids or [])
if limit:
mids = (await redis.lrange(f"chats/{chat_id}/message_ids", offset, offset + limit)) or []
message_ids += mids
mids = await redis.execute("LRANGE", f"chats/{chat_id}/message_ids", offset, offset + limit)
if isinstance(mids, list):
message_ids.extend(mids)
if message_ids:
message_keys = [f"chats/{chat_id}/messages/{mid}" for mid in message_ids]
messages = (await redis.mget(*message_keys)) or []