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

@@ -19,11 +19,11 @@ async def search_recipients(_, info, text: str, limit: int = 50, offset: int = 0
author_id = info.context["author_id"]
existed_chats = await redis.execute("SMEMBERS", f"/chats_by_author/{author_id}")
if isinstance(existed_chats, str):
chats_list = list(json.loads(existed_chats))
for chat_id in chats_list[offset : (offset + limit)]:
members_ids = await redis.execute("GET", f"/chats/{chat_id}/members")
if isinstance(members_ids, list):
if isinstance(existed_chats, set):
chats_list = list(existed_chats)
for chat_id in chats_list[offset: (offset + limit)]:
members_ids = await redis.execute("SMEMBERS", f"/chats/{chat_id}/members")
if isinstance(members_ids, set):
for member_id in members_ids:
author = CacheStorage.authors_by_id.get(member_id)
if author:
@@ -36,6 +36,7 @@ async def search_recipients(_, info, text: str, limit: int = 50, offset: int = 0
return {"members": list(result), "error": None}
@query.field("search_messages")
@login_required
async def search_messages(