File tree 1 file changed +10
-2
lines changed 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -171,9 +171,13 @@ type PollOpts struct {
171
171
}
172
172
173
173
// WithPollOpts configures a Client to use the specified options when polling from the API.
174
+ //
175
+ // If [PollOpts.BackoffFunc] is nil, the existing backoff function will be preserved.
174
176
func WithPollOpts (opts PollOpts ) ClientOption {
175
177
return func (client * Client ) {
176
- client .pollBackoffFunc = opts .BackoffFunc
178
+ if opts .BackoffFunc != nil {
179
+ client .pollBackoffFunc = opts .BackoffFunc
180
+ }
177
181
}
178
182
}
179
183
@@ -195,9 +199,13 @@ type RetryOpts struct {
195
199
196
200
// WithRetryOpts configures a Client to use the specified options when retrying API
197
201
// requests.
202
+ //
203
+ // If [RetryOpts.BackoffFunc] is nil, the existing backoff function will be preserved.
198
204
func WithRetryOpts (opts RetryOpts ) ClientOption {
199
205
return func (client * Client ) {
200
- client .retryBackoffFunc = opts .BackoffFunc
206
+ if opts .BackoffFunc != nil {
207
+ client .retryBackoffFunc = opts .BackoffFunc
208
+ }
201
209
client .retryMaxRetries = opts .MaxRetries
202
210
}
203
211
}
You can’t perform that action at this time.
0 commit comments