Bug fix: get quota and set quota would not retry if an error was hit. (#84)
This commit is contained in:
parent
fa5133c13d
commit
6762c1784b
1 changed files with 9 additions and 12 deletions
21
realis.go
21
realis.go
|
@ -1120,13 +1120,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
|
||||
|
||||
}
|
||||
|
@ -1135,14 +1134,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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue