Files
Nexus/docs/changelog/2026-06-04-schedule-once-rollback.md
T
2026-07-08 22:31:31 +08:00

35 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog — 一次性调度失败回滚(2026-06-04)
## 摘要
修复 `run_mode=once` 的推送/脚本调度在执行失败后无法再次触发的问题。
## 动机
调度器在触发前将 `enabled=False` 并写入 `last_run_at` 以防重复触发;若随后执行失败,旧逻辑只对 cron 回滚 `last_run_at`,一次性任务保持禁用,运维侧表现为「任务跑了一次就永远消失」。
## 变更
| 文件 | 说明 |
|------|------|
| `server/background/schedule_runner.py` | 新增 `rollback_schedule_after_failed_run()`;失败时 once 恢复 `enabled=True` |
| `tests/test_schedule_runner_once.py` | 回滚行为单测 |
| `docs/reports/audit-bug-line-walk-2026-06-04-batch2.md` | BUG Batch 2 审计报告 |
## 迁移 / 重启
- 需重启 Nexus 后端(Supervisor `nexus`)以加载 `schedule_runner` 变更。
- 无数据库迁移。
## 验证
```bash
ruff check server/background/schedule_runner.py
pytest tests/test_schedule_runner_once.py -q
```
## 关联
- BUG-06-04-04Batch 2
- 前序:Batch 1 安装锁与 script callback 聚合 — `docs/changelog/2026-06-04-install-lock-atomic.md`