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