|
|
@@ -45,7 +45,6 @@ class PublishBatchResult:
|
|
|
bind_success: bool = False
|
|
|
bind_error: str | None = None
|
|
|
error: str | None = None
|
|
|
- dry_run: bool = False
|
|
|
|
|
|
def to_dict(self) -> dict[str, Any]:
|
|
|
return {
|
|
|
@@ -60,7 +59,6 @@ class PublishBatchResult:
|
|
|
"bind_success": self.bind_success,
|
|
|
"bind_error": self.bind_error,
|
|
|
"error": self.error,
|
|
|
- "dry_run": self.dry_run,
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -94,7 +92,6 @@ def publish_videos_from_discovery(
|
|
|
run_id: str | None = None,
|
|
|
skip_published: bool = True,
|
|
|
limit: int | None = None,
|
|
|
- dry_run: bool = False,
|
|
|
) -> dict[str, Any]:
|
|
|
"""
|
|
|
从 video_discovery_candidate 读取视频,按轮询均匀分配到各 AIGC 计划对。
|
|
|
@@ -102,7 +99,6 @@ def publish_videos_from_discovery(
|
|
|
仅处理 decision_bucket 为 primary / backup 且 aweme_id 非空的候选,不区分品类。
|
|
|
"""
|
|
|
settings = get_infra_settings()
|
|
|
- effective_dry_run = dry_run or not settings.pipeline_external_effects_enabled
|
|
|
resolved_biz_dt = _resolve_biz_dt(biz_dt)
|
|
|
plan_pairs = list_unique_plan_pairs()
|
|
|
if not plan_pairs:
|
|
|
@@ -130,7 +126,6 @@ def publish_videos_from_discovery(
|
|
|
"plan_count": len(plan_pairs),
|
|
|
"candidate_count": 0,
|
|
|
"decision_buckets": list(_PUBLISHABLE_BUCKETS),
|
|
|
- "dry_run": effective_dry_run,
|
|
|
"batches": [],
|
|
|
}
|
|
|
|
|
|
@@ -140,7 +135,7 @@ def publish_videos_from_discovery(
|
|
|
[bucket for _, bucket in grouped],
|
|
|
)
|
|
|
|
|
|
- client = AigcClient(dry_run=effective_dry_run)
|
|
|
+ client = AigcClient()
|
|
|
timezone = ZoneInfo(settings.scheduler_timezone)
|
|
|
timestamp = datetime.now(timezone).strftime("%Y%m%d%H%M%S")
|
|
|
batch_results: list[PublishBatchResult] = []
|
|
|
@@ -164,7 +159,6 @@ def publish_videos_from_discovery(
|
|
|
publish_plan_id=plan_pair.publish_plan_id,
|
|
|
aweme_ids=aweme_batch,
|
|
|
candidate_ids=id_batch,
|
|
|
- dry_run=effective_dry_run,
|
|
|
)
|
|
|
|
|
|
if not create_result.get("success"):
|
|
|
@@ -186,7 +180,7 @@ def publish_videos_from_discovery(
|
|
|
if not batch.bind_success:
|
|
|
batch.bind_error = str(bind_result.get("error") or "绑定生成计划失败")
|
|
|
|
|
|
- if not effective_dry_run and crawler_plan_id and batch.bind_success:
|
|
|
+ if crawler_plan_id and batch.bind_success:
|
|
|
with get_session() as session:
|
|
|
updated = VideoDiscoveryRepository(session).mark_candidates_aigc_plans(
|
|
|
id_batch,
|
|
|
@@ -216,7 +210,6 @@ def publish_videos_from_discovery(
|
|
|
"distribution": distribution_preview,
|
|
|
"batch_count": len(batch_results),
|
|
|
"failed_batch_count": len(failed_batches),
|
|
|
- "dry_run": effective_dry_run,
|
|
|
"batches": [item.to_dict() for item in batch_results],
|
|
|
}
|
|
|
|
|
|
@@ -233,11 +226,6 @@ if __name__ == "__main__":
|
|
|
parser.add_argument("biz_dt", nargs="?", help="业务日 YYYYMMDD,默认取最新")
|
|
|
parser.add_argument("--run-id", dest="run_id", help="仅处理指定 run_id")
|
|
|
parser.add_argument("--limit", type=int, help="最多处理候选视频数")
|
|
|
- parser.add_argument(
|
|
|
- "--dry-run",
|
|
|
- action="store_true",
|
|
|
- help="只演练分配与请求,不写库",
|
|
|
- )
|
|
|
parser.add_argument(
|
|
|
"--force",
|
|
|
action="store_true",
|
|
|
@@ -252,7 +240,6 @@ if __name__ == "__main__":
|
|
|
run_id=_args.run_id,
|
|
|
skip_published=not _args.force,
|
|
|
limit=_args.limit,
|
|
|
- dry_run=_args.dry_run,
|
|
|
),
|
|
|
label="publish_videos_from_discovery",
|
|
|
)
|