This commit is contained in:
2026-01-18 01:57:11 +08:00
parent ad120687b3
commit c39a01c4c0
3 changed files with 60 additions and 13 deletions

View File

@@ -740,9 +740,10 @@ class ProvisionerBot:
"""包装任务以处理完成通知"""
try:
result = await task
success = sum(1 for r in (result or []) if r.get("status") == "completed")
failed = len(result or []) - success
await self.notifier.notify_task_completed(team_name, success, failed)
# 收集成功和失败的账号
success_accounts = [r.get("email") for r in (result or []) if r.get("status") == "success"]
failed_accounts = [r.get("email") for r in (result or []) if r.get("status") != "success"]
await self.notifier.notify_task_completed(team_name, success_accounts, failed_accounts)
except Exception as e:
await self.notifier.notify_error(f"任务失败: {team_name}", str(e))
finally: