Przeglądaj źródła

Merge remote-tracking branch 'origin/agent_auto_ad_put_ad_adjust_0509_creative' into agent_auto_ad_put_ad_adjust_0509_creative

wangyunpeng 6 dni temu
rodzic
commit
23fc47ac98
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      examples/tencent_realtime_control/run_once.py

+ 5 - 5
examples/tencent_realtime_control/run_once.py

@@ -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,