Skip to content

Commit f10b5da

Browse files
committed
Set setValidateAfterInactivity() on the no-cert client
1 parent 06b0f51 commit f10b5da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/atomgraph/linkeddatahub/Application.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,6 @@ public static Client getClient(KeyStore keyStore, String keyStorePassword, KeySt
13361336
if (keyStore == null) throw new IllegalArgumentException("KeyStore cannot be null");
13371337
if (keyStorePassword == null) throw new IllegalArgumentException("KeyStore password string cannot be null");
13381338
if (trustStore == null) throw new IllegalArgumentException("KeyStore (truststore) cannot be null");
1339-
Integer connIdleTimeout = 5000;
13401339

13411340
// for client authentication
13421341
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
@@ -1385,8 +1384,8 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje
13851384
};
13861385
if (maxConnPerRoute != null) conman.setDefaultMaxPerRoute(maxConnPerRoute);
13871386
if (maxTotalConn != null) conman.setMaxTotal(maxTotalConn);
1388-
conman.setValidateAfterInactivity(connIdleTimeout); // check connections idle for more than Varnish's idle_timeout which is 5s
1389-
//conman.closeIdleConnections(connIdleTimeout, TimeUnit.MILLISECONDS); // match the Varnish idle timeout
1387+
conman.setValidateAfterInactivity(5000); // check connections idle for more than Varnish's idle_timeout which is 5s
1388+
//conman.closeIdleConnections(5, TimeUnit.SECONDS); // Match the Varnish idle timeout
13901389

13911390
ClientConfig config = new ClientConfig();
13921391
config.connectorProvider(new ApacheConnectorProvider());
@@ -1465,6 +1464,7 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje
14651464
};
14661465
if (maxConnPerRoute != null) conman.setDefaultMaxPerRoute(maxConnPerRoute);
14671466
if (maxTotalConn != null) conman.setMaxTotal(maxTotalConn);
1467+
conman.setValidateAfterInactivity(5000); // check connections idle for more than Varnish's idle_timeout which is 5s
14681468

14691469
ClientConfig config = new ClientConfig();
14701470
config.connectorProvider(new ApacheConnectorProvider());

0 commit comments

Comments
 (0)