|
|
@@ -458,10 +458,10 @@ def execute_inventory_action(
|
|
|
if apply or test_notification:
|
|
|
from feishu_notifier import send_action_notification
|
|
|
|
|
|
- successful_actions: dict[int, list[dict[str, Any]]] = {}
|
|
|
- expected_status = "success" if apply else "planned"
|
|
|
+ report_actions: dict[int, list[dict[str, Any]]] = {}
|
|
|
+ expected_statuses = {"success", "failed"} if apply else {"planned"}
|
|
|
for result in results:
|
|
|
- if result.get("status") != expected_status:
|
|
|
+ if result.get("status") not in expected_statuses:
|
|
|
continue
|
|
|
if not (
|
|
|
result.get("bid_change_needed")
|
|
|
@@ -472,11 +472,11 @@ def execute_inventory_action(
|
|
|
)
|
|
|
):
|
|
|
continue
|
|
|
- successful_actions.setdefault(int(result["account_id"]), []).append(
|
|
|
+ report_actions.setdefault(int(result["account_id"]), []).append(
|
|
|
result
|
|
|
)
|
|
|
|
|
|
- for account_id, account_results in successful_actions.items():
|
|
|
+ for account_id, account_results in report_actions.items():
|
|
|
try:
|
|
|
metrics = tencent.get_today_ad_metrics(
|
|
|
account_id,
|