feat: 详细日志(分页/映射/批次进度)+ Artifacts 摘要(sync-summary/verify-report)
This commit is contained in:
@@ -11,7 +11,8 @@ from prefect import flow, task
|
||||
|
||||
from flows.riin._pipeline import sync_riin_records
|
||||
from flows.shared import (
|
||||
SyncDB, create_riin_client, fetch_riin_all_pages, floor_to_hour, format_date,
|
||||
SyncDB, build_stats_rows, create_riin_client, emit_sync_summary, fetch_riin_all_pages,
|
||||
floor_to_hour, format_date,
|
||||
)
|
||||
|
||||
|
||||
@@ -55,6 +56,7 @@ def riin_incremental_sync() -> dict:
|
||||
raw = extract_orders(params)
|
||||
stats = upsert_records(raw)
|
||||
print(f"完成: 订单 {stats['orderCount']} / 商品 {stats['goodsCount']}")
|
||||
emit_sync_summary("RIIN 增量同步", build_stats_rows("RIIN", stats, [("时间范围", f"{params['start_time']} ~ {params['end_time']}")]))
|
||||
return {"syncRange": {"from": params["start_time"], "to": params["end_time"]}, **stats}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user