File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -133,20 +133,18 @@ func (kc *KongClientConfig) ForWorkspace(name string) KongClientConfig {
133133// (HTTP Code 429) is found in the resp parameter. Hence it will return the number of
134134// seconds the server states it may be ready to process more requests from this client.
135135//
136- // This is the same as DefaultBackoff (https://github.com/hashicorp/go-retryablehttp/blob/master /client.go#L510 )
136+ // This is the same as DefaultBackoff (https://github.com/hashicorp/go-retryablehttp/blob/v0.7.1 /client.go#L503 )
137137// except that here we are only retrying on 429s.
138138func backoffStrategy (min , max time.Duration , attemptNum int , resp * http.Response ) time.Duration {
139139 const (
140140 base = 10
141141 bitSize = 64
142142 baseExponential = 2
143143 )
144- if resp != nil {
145- if resp .StatusCode == http .StatusTooManyRequests {
146- if s , ok := resp .Header ["Retry-After" ]; ok {
147- if sleep , err := strconv .ParseInt (s [0 ], base , bitSize ); err == nil {
148- return time .Second * time .Duration (sleep )
149- }
144+ if resp != nil && resp .StatusCode == http .StatusTooManyRequests {
145+ if s , ok := resp .Header ["Retry-After" ]; ok {
146+ if sleep , err := strconv .ParseInt (s [0 ], base , bitSize ); err == nil {
147+ return time .Second * time .Duration (sleep )
150148 }
151149 }
152150 }
You can’t perform that action at this time.
0 commit comments