diff options
author | Nicolas De Loof <nicolas@apache.org> | 2008-01-10 11:00:35 +0000 |
---|---|---|
committer | Nicolas De Loof <nicolas@apache.org> | 2008-01-10 11:00:35 +0000 |
commit | 679b8921cd531a675a5f54da1a9fd282d4919919 (patch) | |
tree | d85f424a97c084c1e701355ec8f4b5fd444777e8 /archiva-base | |
parent | 75a2efd2dd80edfa249a49e031f428f437357707 (diff) | |
download | archiva-679b8921cd531a675a5f54da1a9fd282d4919919.tar.gz archiva-679b8921cd531a675a5f54da1a9fd282d4919919.zip |
skip when URL is in failure cache
cache proxy failures (404) for better performances
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@610758 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-base')
-rw-r--r-- | archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java index 7a34cf895..be4ad1112 100644 --- a/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -524,10 +524,15 @@ public class DefaultRepositoryProxyConnectors getLogger().info( emsg ); return null; } - + + if ( urlFailureCache.hasFailedBefore( url ) ) + { + throw new NotFoundException( "Url has failed before and cache-failure is enabled on this connector" ); + } + Wagon wagon = null; try - { + { RepositoryURL repoUrl = remoteRepository.getURL(); String protocol = repoUrl.getProtocol(); wagon = (Wagon) wagons.get( protocol ); @@ -547,7 +552,10 @@ public class DefaultRepositoryProxyConnectors } catch ( NotFoundException e ) { - // Do not cache url here. + // public repositories may be slow to access, and many request will fail when + // muliple repositories are "merged" by archiva via proxies. + // so caching "not found" is usefull here to enhance archiva response-time + urlFailureCache.cacheFailure( url ); throw e; } catch ( NotModifiedException e ) |