Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into boot2
Browse files Browse the repository at this point in the history
  • Loading branch information
cfieber committed Apr 22, 2019
2 parents 4e85f1b + 29f9990 commit 3f8fa98
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import retrofit.client.OkClient;
import retrofit.converter.JacksonConverter;

import java.util.concurrent.TimeUnit;

@Slf4j
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
Expand All @@ -66,6 +68,14 @@ public FiatService fiatService(FiatClientConfigurationProperties fiatConfigurati

OkHttpClient okHttpClient = okHttpClientConfiguration.create();

if (fiatConfigurationProperties.getConnectTimeoutMs() != null) {
okHttpClient.setConnectTimeout(fiatConfigurationProperties.getConnectTimeoutMs(), TimeUnit.MILLISECONDS);
}

if (fiatConfigurationProperties.getReadTimeoutMs() != null) {
okHttpClient.setConnectTimeout(fiatConfigurationProperties.getReadTimeoutMs(), TimeUnit.MILLISECONDS);
}

return new RestAdapter.Builder()
.setEndpoint(Endpoints.newFixedEndpoint(fiatConfigurationProperties.getBaseUrl()))
.setRequestInterceptor(interceptor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class FiatClientConfigurationProperties {

private boolean refreshable = true;

private Integer connectTimeoutMs;

private Integer readTimeoutMs;

@NestedConfigurationProperty
private PermissionsCache cache = new PermissionsCache();

Expand Down Expand Up @@ -70,7 +74,7 @@ public long getMaxBackoffMillis() {
return maxBackoffMillis;
}

return dynamicConfigService.getConfig(Long.class, "fiat.retry.maxBackoffMills", maxBackoffMillis);
return dynamicConfigService.getConfig(Long.class, "fiat.retry.maxBackoffMillis", maxBackoffMillis);
}

public long getInitialBackoffMillis() {
Expand Down

0 comments on commit 3f8fa98

Please sign in to comment.