Use the default retry limit across client cache (#4727)
This commit is contained in:
3 files changed
+21
-12
No files matched your search
@@ -26,10 +26,13 @@ type ResolvableAliasRetrievalFunc func(ctx context.Context, addr, authTok, userI
|
||||
|
||||
func defaultResolvableAliasFunc(ctx context.Context, addr, authTok, userId string, refreshTok RefreshTokenValue) ([]*aliases.Alias, []string, RefreshTokenValue, error) {
|
||||
const op = "cache.defaultResolvableAliasFunc"
|
||||
client, err := api.NewClient(&api.Config{
|
||||
Addr: addr,
|
||||
Token: authTok,
|
||||
})
|
||||
conf, err := api.DefaultConfig()
|
||||
if err != nil {
|
||||
return nil, nil, "", errors.Wrap(ctx, err, op)
|
||||
}
|
||||
conf.Addr = addr
|
||||
conf.Token = authTok
|
||||
client, err := api.NewClient(conf)
|
||||
if err != nil {
|
||||
return nil, nil, "", errors.Wrap(ctx, err, op)
|
||||
}
|
||||
|
||||
@@ -25,10 +25,13 @@ type SessionRetrievalFunc func(ctx context.Context, addr, authTok string, refres
|
||||
|
||||
func defaultSessionFunc(ctx context.Context, addr, authTok string, refreshTok RefreshTokenValue) ([]*sessions.Session, []string, RefreshTokenValue, error) {
|
||||
const op = "cache.defaultSessionFunc"
|
||||
client, err := api.NewClient(&api.Config{
|
||||
Addr: addr,
|
||||
Token: authTok,
|
||||
})
|
||||
conf, err := api.DefaultConfig()
|
||||
if err != nil {
|
||||
return nil, nil, "", errors.Wrap(ctx, err, op)
|
||||
}
|
||||
conf.Addr = addr
|
||||
conf.Token = authTok
|
||||
client, err := api.NewClient(conf)
|
||||
if err != nil {
|
||||
return nil, nil, "", errors.Wrap(ctx, err, op)
|
||||
}
|
||||
|
||||
@@ -25,10 +25,13 @@ type TargetRetrievalFunc func(ctx context.Context, addr, authTok string, refresh
|
||||
|
||||
func defaultTargetFunc(ctx context.Context, addr, authTok string, refreshTok RefreshTokenValue) ([]*targets.Target, []string, RefreshTokenValue, error) {
|
||||
const op = "cache.defaultTargetFunc"
|
||||
client, err := api.NewClient(&api.Config{
|
||||
Addr: addr,
|
||||
Token: authTok,
|
||||
})
|
||||
conf, err := api.DefaultConfig()
|
||||
if err != nil {
|
||||
return nil, nil, "", errors.Wrap(ctx, err, op)
|
||||
}
|
||||
conf.Addr = addr
|
||||
conf.Token = authTok
|
||||
client, err := api.NewClient(conf)
|
||||
if err != nil {
|
||||
return nil, nil, "", errors.Wrap(ctx, err, op)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user