From f4e8f29fdddafcf059a2b45d93151d19d3494080 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 23 Jan 2024 02:41:37 +0300 Subject: [PATCH] following-fix-2 --- services/following.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/following.py b/services/following.py index 1811e716..4d04c27b 100644 --- a/services/following.py +++ b/services/following.py @@ -39,7 +39,8 @@ class FollowingManager: async def push(kind, payload): try: async with FollowingManager.lock: - for entity in FollowingManager.followers_by_kind.get(kind, []): + entities = FollowingManager.followers_by_kind.get(kind, []) + for entity in entities[:]: # Use a copy to iterate if payload.shout["created_by"] == entity.uid: entity.queue.put_nowait(payload) except Exception as e: