Skip to content

Commit

Permalink
Set setValidateAfterInactivity() on the no-cert client
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Nov 28, 2024
1 parent 06b0f51 commit f10b5da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/atomgraph/linkeddatahub/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,6 @@ public static Client getClient(KeyStore keyStore, String keyStorePassword, KeySt
if (keyStore == null) throw new IllegalArgumentException("KeyStore cannot be null");
if (keyStorePassword == null) throw new IllegalArgumentException("KeyStore password string cannot be null");
if (trustStore == null) throw new IllegalArgumentException("KeyStore (truststore) cannot be null");
Integer connIdleTimeout = 5000;

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

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

ClientConfig config = new ClientConfig();
config.connectorProvider(new ApacheConnectorProvider());
Expand Down

0 comments on commit f10b5da

Please sign in to comment.