Files
Nexus/docs/changelog/2026-06-08-push-async-background.md
T
Nexus Agent 091fb97291
Nexus CI/CD / test (push) Waiting to run
Nexus CI/CD / deploy (push) Blocked by required conditions
Nexus Pre-commit Checks / quick-check (push) Waiting to run
Push async submit, Chinese 422 field labels, hide server CSV export.
Return sync/files immediately with background runner; show loc_zh in validation errors; remove servers toolbar CSV export button.
2026-06-08 23:28:26 +08:00

1.1 KiB

2026-06-08 — 推送按钮改为后台任务提交

变更摘要

文件推送不再阻塞 HTTP 直至全部子机完成;点击「推送」后按钮仅短暂 loading,任务在后台执行,进度由 WebSocket + 下方进度列表展示。

动机

用户反馈推送按钮长时间转圈,期望与脚本执行类似:提交后立即进入后台任务。

根因

POST /api/sync/files 同步等待 sync_engine_v2.sync_files 全部 rsync 结束才返回;前端 :loading="pushing" 与 HTTP 阻塞绑定。

涉及文件

  • server/background/sync_push_runner.py(新)
  • server/api/sync_v2.py — 校验后 schedule_sync_files,返回 accepted: true
  • frontend/src/composables/push/usePushProgress.tssubmitting 与 toast
  • frontend/src/components/push/PushToolbar.vue
  • frontend/src/pages/PushPage.vue

迁移 / 重启

  • 需重启 API / 重建镜像
  • 前端需 build

验证方式

  1. 推送页选多台子机 → 点推送:按钮转圈仅数秒内结束,出现「推送已提交」toast,下方进度条持续更新
  2. pytest tests/test_sync_batch_id.py -q