diff --git a/src/main/java/com/atomgraph/linkeddatahub/Application.java b/src/main/java/com/atomgraph/linkeddatahub/Application.java index c45546a2f..8243cdf16 100644 --- a/src/main/java/com/atomgraph/linkeddatahub/Application.java +++ b/src/main/java/com/atomgraph/linkeddatahub/Application.java @@ -192,7 +192,6 @@ import jakarta.ws.rs.client.Client; import jakarta.ws.rs.client.ClientBuilder; import jakarta.ws.rs.client.ClientRequestFilter; -import java.util.concurrent.ScheduledExecutorService; import javax.xml.transform.TransformerException; import javax.xml.transform.stream.StreamSource; import net.jodah.expiringmap.ExpiringMap; @@ -1387,22 +1386,6 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje if (maxTotalConn != null) conman.setMaxTotal(maxTotalConn); conman.setValidateAfterInactivity(30000); // check connections idle for more than Varnish's idle_timeout which is 5s - Integer idleConnTimeout = 4000; - // create monitor thread that evicts idle connections: https://hc.apache.org/httpcomponents-client-4.5.x/current/tutorial/html/connmgmt.html#d5e418 - ScheduledExecutorService idleConnectionMonitor = Executors.newSingleThreadScheduledExecutor(); - idleConnectionMonitor.scheduleAtFixedRate(() -> - { - try - { - if (log.isDebugEnabled()) log.debug("Evicting idle HTTP connections (every {} ms)", idleConnTimeout); - conman.closeIdleConnections(idleConnTimeout, TimeUnit.MILLISECONDS); - } - catch (Exception ex) - { - if (log.isErrorEnabled()) log.error("Error closing idle connections: {}", ex); - } - }, 0, idleConnTimeout, java.util.concurrent.TimeUnit.MILLISECONDS); - ClientConfig config = new ClientConfig(); config.connectorProvider(new ApacheConnectorProvider()); config.register(MultiPartFeature.class); @@ -1483,22 +1466,6 @@ public void releaseConnection(final HttpClientConnection managedConn, final Obje if (maxConnPerRoute != null) conman.setDefaultMaxPerRoute(maxConnPerRoute); if (maxTotalConn != null) conman.setMaxTotal(maxTotalConn); conman.setValidateAfterInactivity(30000); // check connections idle for more than Varnish's idle_timeout which is 5s - - Integer idleConnTimeout = 4000; - // create monitor thread that evicts idle connections: https://hc.apache.org/httpcomponents-client-4.5.x/current/tutorial/html/connmgmt.html#d5e418 - ScheduledExecutorService idleConnectionMonitor = Executors.newSingleThreadScheduledExecutor(); - idleConnectionMonitor.scheduleAtFixedRate(() -> - { - try - { - if (log.isDebugEnabled()) log.debug("Evicting idle HTTP connections (every {} ms)", idleConnTimeout); - conman.closeIdleConnections(idleConnTimeout, TimeUnit.MILLISECONDS); - } - catch (Exception ex) - { - if (log.isErrorEnabled()) log.error("Error closing idle connections: {}", ex); - } - }, 0, idleConnTimeout, java.util.concurrent.TimeUnit.MILLISECONDS); ClientConfig config = new ClientConfig(); config.connectorProvider(new ApacheConnectorProvider());