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}") +