Fix bug: checking whether the status is null when listing replication jobs

This commit is contained in:
Wenkai Yin 2018-01-16 19:25:18 +08:00
parent 8cda2d8d65
commit 7ebcc82516

View File

@ -108,7 +108,11 @@ func (ra *RepJobAPI) List() {
page, pageSize := ra.GetPaginationParams()
jobs, total, err := dao.FilterRepJobs(policyID, repository, []string{status},
statuses := []string{}
if len(status) > 0 {
statuses = append(statuses, status)
}
jobs, total, err := dao.FilterRepJobs(policyID, repository, statuses,
startTime, endTime, pageSize, pageSize*(page-1))
if err != nil {
log.Errorf("failed to filter jobs according policy ID %d, repository %s, status %s, start time %v, end time %v: %v",