优化排行榜发送逻辑
This commit is contained in:
16
robot.py
16
robot.py
@@ -683,9 +683,17 @@ class Robot(Job):
|
|||||||
receivers = self.gbm.get_group_list()
|
receivers = self.gbm.get_group_list()
|
||||||
if not receivers:
|
if not receivers:
|
||||||
return
|
return
|
||||||
for r in receivers:
|
|
||||||
if self.gbm.get_group_permission(r, Feature.DAILY_SUMMARY) == PermissionStatus.ENABLED:
|
async def send_all():
|
||||||
output = self.message_storage.generate_and_send_ranking(r, self.allContacts)
|
tasks = []
|
||||||
asyncio.run(self.ipad_bot.send_text_message(r, output))
|
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:
|
except Exception as e:
|
||||||
self.LOG.error(f"SendRanking error:{e}")
|
self.LOG.error(f"SendRanking error:{e}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user