fix(orchestrator): prevent concurrent double-run duplicating messages; reflect errors in status

This commit is contained in:
2026-07-01 19:32:04 +07:00
parent 1373aa0a77
commit 2429c786e4
6 changed files with 72 additions and 4 deletions
+4
View File
@@ -74,6 +74,10 @@ func (s *Server) handleRun(w http.ResponseWriter, r *http.Request) {
http.Error(w, "accounts must pass connection tests first", http.StatusConflict)
return
}
if errors.Is(err, orchestrator.ErrAlreadyRunning) {
http.Error(w, "task is already running", http.StatusConflict)
return
}
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return