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

This commit is contained in:
vasyansk committed 2026-07-01 19:32:04 +07:00
1 parent 1373aa0a77
commit 2429c786e4
6 files changed
+72 -4

No files matched your search

+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