feat: 加固运行期可靠性并补齐调度与观测接口

- 运行句柄按 run_id 归属,修复取消后重跑时闸门被旧运行删除的竞态
- 调度循环改用取消令牌退出,启动时对账遗留运行,校验 rows_affected
- 三类任务统一参与调度,新增 /api/v1/stats 与 /api/v1/schedule
- SQLite 启用 WAL 与 busy_timeout,日志清理跳过活跃文件,单行上限 256 KiB
- 前端缓存管理令牌并在 403 时重试一次,仪表盘改用统计接口
This commit is contained in:
2026-10-26 00:38:16 +08:00
parent 773196d689
commit 815258c19b
19 changed files with 990 additions and 93 deletions
+8
View File
@@ -1,6 +1,7 @@
$ErrorActionPreference = 'Stop'
$projectRoot = Split-Path -Parent $PSScriptRoot
$scratch = Join-Path $projectRoot '.tmp'
function Assert-ExitCode {
param([string]$Step)
@@ -10,6 +11,12 @@ function Assert-ExitCode {
}
}
# 测试统一使用仓库内的临时目录:不依赖系统 %TEMP% 的权限策略,
# 也让清理、归档和排障都留在项目目录里。
[void](New-Item -ItemType Directory -Path $scratch -Force)
$env:TMP = $scratch
$env:TEMP = $scratch
Push-Location $projectRoot
try {
pnpm --dir frontend lint
@@ -31,4 +38,5 @@ try {
}
finally {
Pop-Location
Remove-Item -LiteralPath $scratch -Recurse -Force -ErrorAction SilentlyContinue
}