37 lines
1.1 KiB
Markdown
37 lines
1.1 KiB
Markdown
|
|
# 推送页重构 Batch 2
|
||
|
|
|
||
|
|
**日期**: 2026-06-02
|
||
|
|
|
||
|
|
## 变更摘要
|
||
|
|
|
||
|
|
- 批量推送改为单次 `get_by_ids` 查询,消除 N+1。
|
||
|
|
- 手动 ZIP 推送全部成功后自动清理 `/tmp/nexus_upload_*` 临时目录(失败/取消保留供重试)。
|
||
|
|
- `PushItem` 类型与 `/api/servers/logs` 响应对齐;历史表增加模式、错误列,时间用 `started_at`。
|
||
|
|
|
||
|
|
## 动机
|
||
|
|
|
||
|
|
B0/B1 修复功能契约后,B2 处理性能、磁盘与历史展示数据准确性。
|
||
|
|
|
||
|
|
## 涉及文件
|
||
|
|
|
||
|
|
- `server/infrastructure/database/server_repo.py`
|
||
|
|
- `server/application/services/sync_engine_v2.py`
|
||
|
|
- `frontend/src/types/api.ts`
|
||
|
|
- `frontend/src/pages/PushPage.vue`
|
||
|
|
|
||
|
|
## 迁移 / 重启
|
||
|
|
|
||
|
|
- 需重启 `nexus` 后端。
|
||
|
|
- 前端需重新构建部署。
|
||
|
|
|
||
|
|
## 验证方式
|
||
|
|
|
||
|
|
```bash
|
||
|
|
ruff check server/infrastructure/database/server_repo.py server/application/services/sync_engine_v2.py
|
||
|
|
cd frontend && npm run build-only
|
||
|
|
```
|
||
|
|
|
||
|
|
- 多机推送:DB 查询应为 1 次 servers 加载(非每台 1 次)。
|
||
|
|
- ZIP 全成功推送后 `/tmp/nexus_upload_<id>` 目录应被删除;若有失败机则目录保留。
|
||
|
|
- 推送历史表显示开始时间、同步模式、错误信息。
|