mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-13 23:15:10 +00:00
Update go-autorest library to v7.2.3
To include https://github.com/Azure/go-autorest/pull/107 Improves https://github.com/kubernetes/kubernetes/issues/35180
This commit is contained in:
4
vendor/github.com/Azure/go-autorest/autorest/sender.go
generated
vendored
4
vendor/github.com/Azure/go-autorest/autorest/sender.go
generated
vendored
@@ -73,7 +73,7 @@ func SendWithSender(s Sender, r *http.Request, decorators ...SendDecorator) (*ht
|
||||
func AfterDelay(d time.Duration) SendDecorator {
|
||||
return func(s Sender) Sender {
|
||||
return SenderFunc(func(r *http.Request) (*http.Response, error) {
|
||||
if !DelayForBackoff(d, 1, r.Cancel) {
|
||||
if !DelayForBackoff(d, 0, r.Cancel) {
|
||||
return nil, fmt.Errorf("autorest: AfterDelay canceled before full delay")
|
||||
}
|
||||
return s.Do(r)
|
||||
@@ -257,6 +257,8 @@ func WithLogging(logger *log.Logger) SendDecorator {
|
||||
// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set
|
||||
// to zero for no delay. The delay may be canceled by closing the passed channel. If terminated early,
|
||||
// returns false.
|
||||
// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt
|
||||
// count.
|
||||
func DelayForBackoff(backoff time.Duration, attempt int, cancel <-chan struct{}) bool {
|
||||
select {
|
||||
case <-time.After(time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second):
|
||||
|
||||
Reference in New Issue
Block a user