- separate qB sync timer from the planning timer
- threshold cleanup, reserved-plan and pending-import sweeps, 6h reconcile enqueue
engine tasks with time-slot idempotency keys instead of running inline
- pending-import sweep selects by completed_at (sync refreshes updated_at every round)
- POST /download-cache/cleanup and /library/reconcile return {taskId, runId} (202);
web jumps to the engine run page
- test: a 50MB verifyAndImport in progress does not delay qB sync
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@umt/testkit
测试夹具与 mock 服务:mock qB WebUI、mock NexusPHP 站点、mock M-Team API、mock RSS、mock TMDB 与临时目录夹具。只供测试依赖,不进入生产构建。
mock qB 落盘
createMockQb() 默认只改内存状态。e2e 需要"下载完成 → Copy 入库"时:
const qb = await createMockQb();
// files 的 path 相对任务 save_path(多文件种子含根目录);写随机内容,大小与清单一致,返回绝对路径
const paths = await qb.complete(hash, { files: [{ path: "Show.S01/Show.S01E01.mkv", size: 4 * 1024 * 1024 }] });
createMockQb({ materializeFiles: true })让所有complete()按现有文件清单落盘;单次总量上限maxMaterializeBytes(默认 64 MiB)。torrents/delete带deleteFiles=true时同步删除落盘文件和因此变空的目录(不越过 save_path)。- save_path 请用临时目录(
mkdtemp),不要用/downloads这类真实路径。