feat: add batch processing history and real-time status monitoring for team uploads

This commit is contained in:
2026-02-05 08:51:53 +08:00
parent 1718920250
commit 6e6dfded7b
3 changed files with 98 additions and 10 deletions

View File

@@ -167,6 +167,13 @@ func HandleTeamProcess(w http.ResponseWriter, r *http.Request) {
}
}
// 启动新任务前,先清理数据库中遗留的 running 状态批次
if database.Instance != nil {
if affected, err := database.Instance.CleanupStuckBatchRuns(); err == nil && affected > 0 {
logger.Warning(fmt.Sprintf("清理了 %d 个遗留的运行中批次记录", affected), "", "team")
}
}
// 初始化状态
teamProcessState.Running = true
teamProcessState.StartedAt = time.Now()