5ed3c28491
rsync 抛错时 sync_log 不再永久 running;reconcile 兼容 naive UTC。 Co-authored-by: Cursor <cursoragent@cursor.com>
1.2 KiB
1.2 KiB
Changelog — 2026-06-07 推送历史「进行中」订正与异常落库
摘要
推送失败时 sync_logs 长期停留在 running(进行中),导致推送历史大量「进行中」。根因:rsync 进程启动异常(如容器缺 rsync)在 _rsync_push 抛出未捕获异常,终态未写入 DB。
动机
用户反馈推送历史里很多「进行中」;生产库核实 7/7 条均为 running,对应今日多次 rsync 缺失导致的推送尝试。
变更
sync_engine_v2.py:_rsync_push异常转为exit_code=-1,保证sync_log落库为failedsync_log_repo.py:订正卡住记录时兼容 MySQL naive UTC 与 aware datetime 相减usePushLogs.ts:「修复卡住记录」阈值 120 分钟 → 15 分钟- 生产数据:7 条历史
running已订正为failed
涉及文件
server/application/services/sync_engine_v2.pyserver/infrastructure/database/sync_log_repo.pyfrontend/src/composables/push/usePushLogs.ts
迁移 / 重启
- 需部署后端 + 前端构建
- 无 DB 迁移
验证
- 推送历史无残留「进行中」(或点「修复卡住记录」可订正 >15 分钟的卡住项)
- 模拟 rsync 失败时
sync_logs.status应为failed而非running