Merge pull request #4038 from ywk253100/180116_bug_fix

Fix bug: checking whether the status is null when listing replication jobs
This commit is contained in:
Wenkai Yin 2018-01-17 12:06:22 +08:00 committed by GitHub
commit 45894de89a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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",