Skip to content

Commit f421c8e

Browse files
author
Ajay Kannan
committed
Set default retry strategy
1 parent 5a23e57 commit f421c8e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ public B authCredentials(AuthCredentials authCredentials) {
264264

265265
/**
266266
* Sets configuration parameters for request retries. If no configuration is set
267-
* {@link RetryParams#noRetries()} is used.
267+
* {@link RetryParams#defaultInstance()} is used. To disable retries, supply
268+
* {@link RetryParams#noRetries()} here.
268269
*
269270
* @return the builder
270271
*/
@@ -325,7 +326,7 @@ protected ServiceOptions(Class<? extends ServiceFactory<ServiceT, OptionsT>> ser
325326
authCredentials =
326327
builder.authCredentials != null ? builder.authCredentials : defaultAuthCredentials();
327328
authCredentialsState = authCredentials != null ? authCredentials.capture() : null;
328-
retryParams = builder.retryParams;
329+
retryParams = firstNonNull(builder.retryParams, RetryParams.defaultInstance());
329330
serviceFactory = firstNonNull(builder.serviceFactory,
330331
getFromServiceLoader(serviceFactoryClass, defaultServiceFactory()));
331332
serviceFactoryClassName = serviceFactory.getClass().getName();

0 commit comments

Comments
 (0)