Files

40 lines
2.0 KiB
Python

"""一键部署全部 12 个同步 flow(单进程注册所有 deployment)。
运行后,所有 flow + deployment 立即出现在 Prefect UI,并按各自 cron 调度执行:
uv run python serve_all.py
不想立即跑调度?部署后在 UI 的 Deployments 页面暂停(pause)对应 deployment 即可,
flow 仍会显示在 Flows 列表中。
"""
from prefect import serve
from flows.riin.by_orders import riin_by_orders_sync
from flows.riin.incremental_sync import riin_incremental_sync
from flows.riin.order_sync import riin_order_sync
from flows.riin.recent_sync import riin_recent_sync
from flows.riin.refresh_pending import riin_refresh_pending
from flows.riin.verify import riin_verify
from flows.sds.incremental_sync import sds_incremental_sync
from flows.sds.order_sync import sds_order_sync
from flows.sds.recent_sync import sds_recent_sync
from flows.sds.refresh_100_prefix import sds_refresh_100_prefix
from flows.sds.refresh_pending import sds_refresh_pending
from flows.sds.verify import sds_verify
if __name__ == "__main__":
serve(
riin_order_sync.to_deployment(name="riin-order-sync"),
riin_incremental_sync.to_deployment(name="riin-incremental-sync", cron="0 * * * *"),
riin_recent_sync.to_deployment(name="riin-recent-sync", cron="30 * * * *"),
riin_refresh_pending.to_deployment(name="riin-refresh-pending", cron="0 */3 * * *"),
riin_by_orders_sync.to_deployment(name="riin-by-orders-sync"),
sds_order_sync.to_deployment(name="sds-order-sync"),
sds_incremental_sync.to_deployment(name="sds-incremental-sync", cron="15 * * * *"),
sds_recent_sync.to_deployment(name="sds-recent-sync", cron="45 * * * *"),
sds_refresh_pending.to_deployment(name="sds-refresh-pending", cron="0 */2 * * *"),
sds_refresh_100_prefix.to_deployment(name="sds-refresh-100-prefix", cron="30 */2 * * *"),
riin_verify.to_deployment(name="riin-verify", cron="0 6 * * *"),
sds_verify.to_deployment(name="sds-verify", cron="0 7 * * *"),
)