Merge pull request #392 from ywk253100/update_and_create_policy_api_modify

bug fix: fixed policy can not be updated
This commit is contained in:
Wenkai Yin 2016-06-22 18:33:37 +08:00 committed by GitHub
commit 53abe230a0

View File

@ -281,6 +281,11 @@ func (pa *RepPolicyAPI) Put() {
}
*/
if err = dao.UpdateRepPolicy(policy); err != nil {
log.Errorf("failed to update policy %d: %v", id, err)
pa.CustomAbort(http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError))
}
if policy.Enabled != originalPolicy.Enabled && policy.Enabled == 1 {
go func() {
if err := TriggerReplication(id, "", nil, models.RepOpTransfer); err != nil {