Add a 5x exponential backoff on 429s & 5xxs to the webhook Authenticator/Authorizer.

This commit is contained in:
CJ Cullen
2016-06-23 17:37:09 -07:00
parent e294b23674
commit 38a1042199
5 changed files with 59 additions and 10 deletions

View File

@@ -183,7 +183,7 @@ current-context: default
return fmt.Errorf("failed to execute test template: %v", err)
}
// Create a new authorizer
_, err = New(p, 0, 0)
_, err = newWithBackoff(p, 0, 0, 0)
return err
}()
if err != nil && !tt.wantErr {
@@ -291,7 +291,7 @@ func newAuthorizer(callbackURL string, clientCert, clientKey, ca []byte, cacheTi
if err := json.NewEncoder(tempfile).Encode(config); err != nil {
return nil, err
}
return New(p, cacheTime, cacheTime)
return newWithBackoff(p, cacheTime, cacheTime, 0)
}
func TestTLSConfig(t *testing.T) {