Fixing bug where get quota and set quota would not retry if an error was hit.

This commit is contained in:
Renan DelValle 2018-10-22 18:24:36 -07:00
parent 2306d6180f
commit 888c20ef90
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9

View file

@ -1063,13 +1063,12 @@ func (r *realisClient) SetQuota(role string, cpu *float64, ramMb *int64, diskMb
quota.Resources[c] = true
quota.Resources[d] = true
resp, retryErr := r.thriftCallWithRetries(func() (*aurora.Response, error) {
resp, retryErr := r.adminClient.SetQuota(role, quota)
if retryErr != nil {
return nil, errors.Wrap(retryErr, "Unable to set role quota")
}
return resp, nil
return r.adminClient.SetQuota(role, quota)
})
if retryErr != nil {
return resp, errors.Wrap(retryErr, "Unable to set role quota")
}
return resp, retryErr
}
@ -1078,14 +1077,12 @@ func (r *realisClient) SetQuota(role string, cpu *float64, ramMb *int64, diskMb
func (r *realisClient) GetQuota(role string) (*aurora.Response, error) {
resp, retryErr := r.thriftCallWithRetries(func() (*aurora.Response, error) {
resp, retryErr := r.adminClient.GetQuota(role)
if retryErr != nil {
return nil, errors.Wrap(retryErr, "Unable to get role quota")
}
return resp, nil
return r.adminClient.GetQuota(role)
})
if retryErr != nil {
return resp, errors.Wrap(retryErr, "Unable to get role quota")
}
return resp, retryErr
}