forked from toolshed/abra
build: go 1.24
We were running behind and there were quite some deprecations to update. This was mostly in the upstream copy/pasta package but seems quite minimal.
This commit is contained in:
17
vendor/google.golang.org/grpc/service_config.go
generated
vendored
17
vendor/google.golang.org/grpc/service_config.go
generated
vendored
@ -268,18 +268,21 @@ func parseServiceConfig(js string, maxAttempts int) *serviceconfig.ParseResult {
|
||||
return &serviceconfig.ParseResult{Config: &sc}
|
||||
}
|
||||
|
||||
func isValidRetryPolicy(jrp *jsonRetryPolicy) bool {
|
||||
return jrp.MaxAttempts > 1 &&
|
||||
jrp.InitialBackoff > 0 &&
|
||||
jrp.MaxBackoff > 0 &&
|
||||
jrp.BackoffMultiplier > 0 &&
|
||||
len(jrp.RetryableStatusCodes) > 0
|
||||
}
|
||||
|
||||
func convertRetryPolicy(jrp *jsonRetryPolicy, maxAttempts int) (p *internalserviceconfig.RetryPolicy, err error) {
|
||||
if jrp == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if jrp.MaxAttempts <= 1 ||
|
||||
jrp.InitialBackoff <= 0 ||
|
||||
jrp.MaxBackoff <= 0 ||
|
||||
jrp.BackoffMultiplier <= 0 ||
|
||||
len(jrp.RetryableStatusCodes) == 0 {
|
||||
logger.Warningf("grpc: ignoring retry policy %v due to illegal configuration", jrp)
|
||||
return nil, nil
|
||||
if !isValidRetryPolicy(jrp) {
|
||||
return nil, fmt.Errorf("invalid retry policy (%+v): ", jrp)
|
||||
}
|
||||
|
||||
if jrp.MaxAttempts < maxAttempts {
|
||||
|
Reference in New Issue
Block a user