following manager does not manage chats

This commit is contained in:
Untone 2023-10-16 17:50:40 +03:00
parent 0c75902a64
commit 34e6a03a89

View File

@ -22,7 +22,7 @@ class FollowingManager:
'author': [], 'author': [],
'topic': [], 'topic': [],
'shout': [], 'shout': [],
'chat': [] 'community': []
} }
@staticmethod @staticmethod
@ -39,13 +39,8 @@ class FollowingManager:
async def push(kind, payload): async def push(kind, payload):
try: try:
async with FollowingManager.lock: async with FollowingManager.lock:
if kind == 'chat': for entity in FollowingManager[kind]:
for chat in FollowingManager['chat']: if payload.shout['createdBy'] == entity.uid:
if payload.message["chatId"] == chat.uid: entity.queue.put_nowait(payload)
chat.queue.put_nowait(payload)
else:
for entity in FollowingManager[kind]:
if payload.shout['createdBy'] == entity.uid:
entity.queue.put_nowait(payload)
except Exception as e: except Exception as e:
print(Exception(e)) print(Exception(e))