优化排行榜发送逻辑

This commit is contained in:
liuwei
2025-05-20 09:52:16 +08:00
parent 797f80b37c
commit 5a668ed132

View File

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