File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
http-clients/apache5-client/src/main/java/software/amazon/awssdk/http/apache5 Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -739,16 +739,14 @@ public PoolingHttpClientConnectionManager create(Apache5HttpClient.DefaultBuilde
739
739
private static ConnectionConfig getConnectionConfig (AttributeMap standardOptions ) {
740
740
ConnectionConfig .Builder connectionConfigBuilder =
741
741
ConnectionConfig .custom ()
742
- .setConnectTimeout (
743
- Timeout .of (standardOptions .get (SdkHttpConfigurationOption .CONNECTION_TIMEOUT ).toMillis (),
744
- TimeUnit .MILLISECONDS ))
745
- .setSocketTimeout (
746
- Timeout .of (standardOptions .get (SdkHttpConfigurationOption .READ_TIMEOUT ).toMillis (),
747
- TimeUnit .MILLISECONDS ));
742
+ .setConnectTimeout (Timeout .ofMilliseconds (
743
+ standardOptions .get (SdkHttpConfigurationOption .CONNECTION_TIMEOUT ).toMillis ()))
744
+ .setSocketTimeout (Timeout .ofMilliseconds (
745
+ standardOptions .get (SdkHttpConfigurationOption .READ_TIMEOUT ).toMillis ()));
748
746
Duration connectionTtl = standardOptions .get (SdkHttpConfigurationOption .CONNECTION_TIME_TO_LIVE );
749
747
if (!connectionTtl .isZero ()) {
750
748
// Skip TTL=0 to maintain backward compatibility (infinite in 4.x vs immediate expiration in 5.x)
751
- connectionConfigBuilder .setTimeToLive (TimeValue .of (connectionTtl .toMillis (), TimeUnit . MILLISECONDS ));
749
+ connectionConfigBuilder .setTimeToLive (TimeValue .ofMilliseconds (connectionTtl .toMillis ()));
752
750
}
753
751
return connectionConfigBuilder .build ();
754
752
}
You can’t perform that action at this time.
0 commit comments