fix(orchestrator): prevent concurrent double-run duplicating messages; reflect errors in status
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user