diff --git a/cli/encode-pool/main.go b/cli/encode-pool/main.go index ca32452..8f4d3f1 100644 --- a/cli/encode-pool/main.go +++ b/cli/encode-pool/main.go @@ -9,7 +9,6 @@ import ( encode_utils "git.gammaspectra.live/S.O.N.G/Ignite/cli/encode-utils" "gopkg.in/yaml.v3" "io" - "maps" "net/http" "net/url" "os" @@ -237,20 +236,9 @@ func main() { w.WriteHeader(http.StatusNotFound) return } else { + jobs = slices.Delete(jobs, i, i+1) job := jobs[i] - response, err := job.Server.Pass(r, [2]string{"k", job.Server.Key}, [2]string{"jobId", job.ServerId}) - defer response.Body.Close() - defer io.ReadAll(response.Body) - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - if response.StatusCode == http.StatusOK { - jobs = slices.Delete(jobs, i, i+1) - } - maps.Copy(w.Header(), response.Header) - w.WriteHeader(response.StatusCode) - _, _ = io.Copy(w, response.Body) + job.Server.Redirect(w, r, [2]string{"k", job.Server.Key}, [2]string{"jobId", job.ServerId}) } })