feat: 详细日志(分页/映射/批次进度)+ Artifacts 摘要(sync-summary/verify-report)

This commit is contained in:
yeuimu
2026-07-23 09:01:39 +00:00
parent 367168bcdc
commit 4ec7cf2dd6
18 changed files with 154 additions and 22 deletions
+4 -1
View File
@@ -11,7 +11,9 @@ from prefect import flow, task
from api.riin.models import OrderPageRequest
from flows.riin._pipeline import sync_riin_records
from flows.shared import SyncDB, create_riin_client, fetch_riin_all_pages, format_date
from flows.shared import (
SyncDB, build_stats_rows, create_riin_client, emit_sync_summary, fetch_riin_all_pages, format_date,
)
@task(retries=3, retry_delay_seconds=[3, 6, 9])
@@ -70,6 +72,7 @@ def riin_order_sync(
raw = extract_orders(params)
stats = upsert_records(raw)
print(f"完成: 订单 {stats['orderCount']} / 商品 {stats['goodsCount']} | {stats}")
emit_sync_summary("RIIN 订单同步", build_stats_rows("RIIN", stats, [("时间范围", f"{order_date_begin} ~ {order_date_end}")]))
return {"syncRange": {"from": order_date_begin, "to": order_date_end}, **stats}