Merge pull request #4823 from ywk253100/180430_delete_rule_cherrypick

Cherry pick: Fix bug #4819: the scheduled rule can not be removed
This commit is contained in:
Wenkai Yin 2018-04-30 19:03:08 +08:00 committed by GitHub
commit 696c39350e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,6 +252,8 @@ func (pa *RepPolicyAPI) Delete() {
count, err := dao.GetTotalCountOfRepJobs(&models.RepJobQuery{
PolicyID: id,
Statuses: []string{models.JobRunning, models.JobRetrying, models.JobPending},
// only get the transfer and delete jobs, do not get schedule job
Operations: []string{models.RepOpTransfer, models.RepOpDelete},
})
if err != nil {
log.Errorf("failed to filter jobs of policy %d: %v", id, err)