diff options
Diffstat (limited to 'internal/api/server.go')
| -rw-r--r-- | internal/api/server.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/api/server.go b/internal/api/server.go index df35536..163f2b8 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -488,9 +488,10 @@ func (s *Server) handleGetTask(w http.ResponseWriter, r *http.Request) { } writeJSON(w, http.StatusOK, t) } - func (s *Server) handleRunTask(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") + agent := r.URL.Query().Get("agent") + t, err := s.store.ResetTaskForRetry(id) if err != nil { if strings.Contains(err.Error(), "not found") { @@ -505,6 +506,10 @@ func (s *Server) handleRunTask(w http.ResponseWriter, r *http.Request) { return } + if agent != "" && agent != "auto" { + t.Agent.Type = agent + } + if err := s.pool.Submit(context.Background(), t); err != nil { writeJSON(w, http.StatusServiceUnavailable, map[string]string{"error": fmt.Sprintf("executor pool: %v", err)}) return |
