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
+3 -2
View File
@@ -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, format_date, get_channel_type_map,
refresh_channel_type_map, start_of_day,
SyncDB, build_stats_rows, create_sds_client, emit_sync_summary, fetch_sds_all_pages,
format_date, get_channel_type_map, refresh_channel_type_map, start_of_day,
)
@@ -48,6 +48,7 @@ def sds_recent_sync(recent_days: int = 7) -> dict:
raw = extract_orders(params)
stats = upsert_records(raw)
print(f"完成: 订单 {stats['orderCount']} / 商品 {stats['goodsCount']}")
emit_sync_summary("SDS 近期同步", build_stats_rows("SDS", stats, [("近N天", days), ("时间范围", f"{params['created_date_begin']} ~ {params['created_date_end']}")]))
return {"syncRange": {"from": params["created_date_begin"], "to": format_date(now)},
"recentDays": days, **stats}