From d0bb3dd13695bc402ac1f14f537fc4b2b15fa66e Mon Sep 17 00:00:00 2001 From: Poorna Date: Tue, 1 Oct 2024 23:38:17 -0700 Subject: [PATCH] list all batch job types (#20510) continues #20480 --- cmd/batch-handlers.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/batch-handlers.go b/cmd/batch-handlers.go index 7dbda7583..b7ba53ce9 100644 --- a/cmd/batch-handlers.go +++ b/cmd/batch-handlers.go @@ -1577,9 +1577,6 @@ func (a adminAPIHandlers) ListBatchJobs(w http.ResponseWriter, r *http.Request) } jobType := r.Form.Get("jobType") - if jobType == "" { - jobType = string(madmin.BatchJobReplicate) - } resultCh := make(chan itemOrErr[ObjectInfo]) @@ -1608,7 +1605,7 @@ func (a adminAPIHandlers) ListBatchJobs(w http.ResponseWriter, r *http.Request) continue } - if jobType == string(req.Type()) { + if jobType == string(req.Type()) || jobType == "" { listResult.Jobs = append(listResult.Jobs, madmin.BatchJobResult{ ID: req.ID, Type: req.Type(), @@ -2049,7 +2046,9 @@ func (j *BatchJobPool) canceler(jobID string, cancel bool) error { canceler() } } - delete(j.jobCancelers, jobID) + if cancel { + delete(j.jobCancelers, jobID) + } return nil }