Merge pull request #536 from ywk253100/bug_fix_for_trigger_disabled_policy

Do not trigger replication if the policy is disabled
This commit is contained in:
Wenkai Yin 2016-07-13 18:06:48 +08:00 committed by GitHub
commit 8226704032

View File

@ -162,6 +162,9 @@ func TriggerReplicationByRepository(repository string, tags []string, operation
} }
for _, policy := range policies { for _, policy := range policies {
if policy.Enabled == 0 {
continue
}
if err := TriggerReplication(policy.ID, repository, tags, operation); err != nil { if err := TriggerReplication(policy.ID, repository, tags, operation); err != nil {
log.Errorf("failed to trigger replication of policy %d for %s: %v", policy.ID, repository, err) log.Errorf("failed to trigger replication of policy %d for %s: %v", policy.ID, repository, err)
} else { } else {