Okey dokey, thanks Nico! -Deng
On Jan 11, 2008 5:12 PM, nicolas de loof <[EMAIL PROTECTED]> wrote: > I've reverted my change. > > The cacheUrlFailure is not set on an "one-instance-per-connector" basis > and > using it has for side effect to break the test expectation. > I missunderstood what it was designed for, and am not familiar enought > with > plexus to change the cacheFailure nature to a "prototype" (using Spring > vocabulary). > > Nico. > > > 2008/1/11, Maria Odea Ching <[EMAIL PROTECTED]>: > > > > Hi Nicolas, > > > > I'm getting test failures in archiva-proxy after this change, > specifically > > in CacheFailuresTransferTest. > > Could you please update the test case to reflect these changes? :) > > > > Thanks, > > Deng > > > > > > On Jan 10, 2008 7:00 PM, <[EMAIL PROTECTED]> wrote: > > > > > Author: nicolas > > > Date: Thu Jan 10 03:00:35 2008 > > > New Revision: 610758 > > > > > > URL: http://svn.apache.org/viewvc?rev=610758&view=rev > > > Log: > > > skip when URL is in failure cache > > > cache proxy failures (404) for better performances > > > > > > Modified: > > > > > > > > > > maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java > > > > > > Modified: > > > > > > maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java > > > URL: > > > > > > http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java?rev=610758&r1=610757&r2=610758&view=diff > > > > > > > > > ============================================================================== > > > --- > > > > > > maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java > > > (original) > > > +++ > > > > > > maven/archiva/trunk/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java > > > Thu Jan 10 03:00:35 2008 > > > @@ -524,10 +524,15 @@ > > > 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 @@ > > > } > > > 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 ) > > > > > > > > > > > >
