From 229276f8d933089dcfec615189ac31259aa45697 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Tue, 27 Sep 2016 08:40:37 +1000 Subject: [PATCH] cosmetic :-) Signed-off-by: olivier lamy --- .../DefaultRepositoryProxyConnectors.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java index 864d80690..5d6087415 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -48,8 +48,8 @@ import org.apache.archiva.policies.urlcache.UrlFailureCache; import org.apache.archiva.proxy.common.WagonFactory; import org.apache.archiva.proxy.common.WagonFactoryException; import org.apache.archiva.proxy.common.WagonFactoryRequest; -import org.apache.archiva.proxy.model.ProxyFetchResult; import org.apache.archiva.proxy.model.ProxyConnector; +import org.apache.archiva.proxy.model.ProxyFetchResult; import org.apache.archiva.proxy.model.RepositoryProxyConnectors; import org.apache.archiva.redback.components.registry.Registry; import org.apache.archiva.redback.components.registry.RegistryListener; @@ -90,7 +90,6 @@ import java.io.IOException; import java.nio.file.Files; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -98,6 +97,7 @@ import java.util.Map.Entry; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.TimeUnit; /** * DefaultRepositoryProxyConnectors @@ -1184,12 +1184,13 @@ public class DefaultRepositoryProxyConnectors } // Convert seconds to milliseconds - int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000; + long timeoutInMilliseconds = TimeUnit.MILLISECONDS.convert( remoteRepository.getRepository().getTimeout(), // + TimeUnit.SECONDS ); // Set timeout read and connect // FIXME olamy having 2 config values - wagon.setReadTimeout( timeoutInMilliseconds ); - wagon.setTimeout( timeoutInMilliseconds ); + wagon.setReadTimeout( (int) timeoutInMilliseconds ); + wagon.setTimeout( (int) timeoutInMilliseconds ); try { @@ -1263,9 +1264,10 @@ public class DefaultRepositoryProxyConnectors @Override public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) { - if ( ConfigurationNames.isNetworkProxy( propertyName ) || ConfigurationNames.isManagedRepositories( - propertyName ) || ConfigurationNames.isRemoteRepositories( propertyName ) - || ConfigurationNames.isProxyConnector( propertyName ) ) + if ( ConfigurationNames.isNetworkProxy( propertyName ) // + || ConfigurationNames.isManagedRepositories( propertyName ) // + || ConfigurationNames.isRemoteRepositories( propertyName ) // + || ConfigurationNames.isProxyConnector( propertyName ) ) // { initConnectorsAndNetworkProxies(); } -- 2.39.5