list all batch job types (#20510)

continues #20480
This commit is contained in:
Poorna 2024-10-01 23:38:17 -07:00 committed by GitHub
parent ab7714b01e
commit d0bb3dd136
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 5 deletions

View File

@ -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
}