- flows/shared/wecom.py: WSClient 按需连接(连接→认证→发送→断开),全容错,超长分段 - flows/monitor/alert_failure.py: Prefect 事件触发(Failed/Crashed→run deployment),发群报警 - flows/monitor/daily_report.py: 每日 18:30 近7天 RIIN/SDS 核验(复用 verify)+商品完整性+OCR+失败回顾 - flows/monitor/device_check.py: 每日 09:00 内存/磁盘/GPU(80%阈值)+Docker 容器异常+服务探活 - db.py: 新增 get_goods_integrity/ping; compose worker 挂载 docker.sock+/:/host:ro+GPU - scripts/wecom_capture_chatid.py: 一次性捕获群 chat_id 工具
32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
"""同步编排共享层:客户端/分页、映射、PG 写入、Artifacts。"""
|
|
|
|
from flows.shared import clients, db, mappers
|
|
from flows.shared.artifacts import build_stats_rows, emit_sync_summary, emit_verify_report
|
|
from flows.shared.clients import (
|
|
create_riin_client,
|
|
create_sds_client,
|
|
fetch_goods_concurrent,
|
|
fetch_riin_all_pages,
|
|
fetch_sds_all_pages,
|
|
floor_to_hour,
|
|
format_date,
|
|
get_channel_type_map,
|
|
refresh_channel_type_map,
|
|
resolve_courier_source,
|
|
start_of_day,
|
|
)
|
|
from flows.shared.db import SyncDB
|
|
from flows.shared.mappers import GoodsUpsertInput, OrderUpsertInput
|
|
from flows.shared.wecom import send_markdown, send_text
|
|
|
|
__all__ = [
|
|
"clients", "db", "mappers", "SyncDB",
|
|
"OrderUpsertInput", "GoodsUpsertInput",
|
|
"create_riin_client", "create_sds_client",
|
|
"fetch_riin_all_pages", "fetch_sds_all_pages", "fetch_goods_concurrent",
|
|
"get_channel_type_map", "refresh_channel_type_map", "resolve_courier_source",
|
|
"format_date", "start_of_day", "floor_to_hour",
|
|
"build_stats_rows", "emit_sync_summary", "emit_verify_report",
|
|
"send_markdown", "send_text",
|
|
]
|