File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,14 @@ func makeOptions(opts ...Option) (*options, error) {
162162 o .transport = transport .NewLogger (o .transport )
163163 }
164164
165+ // Using customized retry predicate if provided, and fallback to default if not.
166+ predicate := o .retryPredicate
167+ if predicate == nil {
168+ predicate = defaultRetryPredicate
169+ }
170+
165171 // Wrap the transport in something that can retry network flakes.
166- o .transport = transport .NewRetry (o .transport , transport .WithRetryPredicate (defaultRetryPredicate ), transport .WithRetryStatusCodes (o .retryStatusCodes ... ))
172+ o .transport = transport .NewRetry (o .transport , transport .WithRetryPredicate (predicate ), transport .WithRetryStatusCodes (o .retryStatusCodes ... ))
167173
168174 // Wrap this last to prevent transport.New from double-wrapping.
169175 if o .userAgent != "" {
You can’t perform that action at this time.
0 commit comments