sync-precache
All checks were successful
deploy / deploy (push) Successful in 1m3s

This commit is contained in:
2023-12-19 18:31:31 +03:00
parent a0d111c50d
commit b141c26e80
5 changed files with 21 additions and 28 deletions

View File

@@ -2,12 +2,6 @@ from resolvers.chats import create_chat, delete_chat, update_chat
from resolvers.load import load_chats, load_messages_by, load_recipients
from resolvers.messages import create_message, delete_message, mark_as_read, update_message
from resolvers.search import search_messages, search_recipients
from services.core import get_all_authors
import asyncio
print("[resolvers] init precache: getting all authors...")
asyncio.create_task(get_all_authors())
__all__ = [
# inbox

View File

@@ -116,7 +116,7 @@ async def load_recipients(_, _info, limit=50, offset=0):
"""load possible chat participants"""
onliners: List[int] = (await redis.execute("SMEMBERS", "authors-online")) or []
r = []
my_followings: List[ChatMember] = await get_my_followed()
my_followings: List[ChatMember] = get_my_followed()
if len(my_followings) < limit:
my_followings = my_followings + list(authors_by_id.values())[offset : limit - len(my_followings)]
my_followings = list(set(my_followings))