Skip to content

Commit

Permalink
Revert "chore(vault): custom retry check function (SAP#4475)" (SAP#4616)
Browse files Browse the repository at this point in the history
This reverts commit 2ab1e2a.
  • Loading branch information
jliempt authored and maxatsap committed Jul 23, 2024
1 parent 62d06b3 commit 4427eb7
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions pkg/vault/client.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package vault

import (
"context"
"encoding/json"
"fmt"
"net/http"
"path"
"strconv"
"strings"
Expand Down Expand Up @@ -43,25 +41,6 @@ func NewClient(config *Config, token string) (Client, error) {
return Client{}, err
}

client.SetMinRetryWait(time.Second * 3)
client.SetMaxRetryWait(time.Second * 5)
client.SetCheckRetry(func(ctx context.Context, resp *http.Response, err error) (bool, error) {
if resp != nil {
log.Entry().Infoln("Vault retry: ", resp.Status, resp.StatusCode, err)
} else {
log.Entry().Infoln("Vault retry: ", err)
}

retry, err := api.DefaultRetryPolicy(ctx, resp, err)
if err != nil || retry {
return true, nil
}
if resp != nil && resp.StatusCode >= 400 {
return true, nil
}
return false, nil
})

if config.Namespace != "" {
client.SetNamespace(config.Namespace)
}
Expand Down

0 comments on commit 4427eb7

Please sign in to comment.