Merge pull request #5924 from cd1989/replication-status-check

Fix statuses condition when trigger replication
This commit is contained in:
Wenkai Yin 2018-10-15 11:26:22 +08:00 committed by GitHub
commit 0ebed68f5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,8 +64,9 @@ func (r *ReplicationAPI) Post() {
} }
count, err := dao.GetTotalCountOfRepJobs(&models.RepJobQuery{ count, err := dao.GetTotalCountOfRepJobs(&models.RepJobQuery{
PolicyID: replication.PolicyID, PolicyID: replication.PolicyID,
Statuses: []string{models.RepOpTransfer, models.RepOpDelete}, Statuses: []string{models.JobPending, models.JobRunning},
Operations: []string{models.RepOpTransfer, models.RepOpDelete},
}) })
if err != nil { if err != nil {
r.HandleInternalServerError(fmt.Sprintf("failed to filter jobs of policy %d: %v", r.HandleInternalServerError(fmt.Sprintf("failed to filter jobs of policy %d: %v",