From 5a668ed1328220fcb886ddac99b95d6b081e910a Mon Sep 17 00:00:00 2001 From: liuwei Date: Tue, 20 May 2025 09:52:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=92=E8=A1=8C=E6=A6=9C?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/robot.py b/robot.py index c8ff74e..ffa94e8 100644 --- a/robot.py +++ b/robot.py @@ -683,9 +683,17 @@ class Robot(Job): receivers = self.gbm.get_group_list() if not receivers: return - for r in receivers: - if self.gbm.get_group_permission(r, Feature.DAILY_SUMMARY) == PermissionStatus.ENABLED: - output = self.message_storage.generate_and_send_ranking(r, self.allContacts) - asyncio.run(self.ipad_bot.send_text_message(r, output)) + + async def send_all(): + tasks = [] + for r in receivers: + if self.gbm.get_group_permission(r, Feature.DAILY_SUMMARY) == PermissionStatus.ENABLED: + output = self.message_storage.generate_and_send_ranking(r, self.allContacts) + tasks.append(self.ipad_bot.send_text_message(r, output)) + await asyncio.gather(*tasks) + + asyncio.run(send_all()) + except Exception as e: self.LOG.error(f"SendRanking error:{e}") +