Correcting 'last refresh timestamp' on webpage.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@516433 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2007-03-09 15:27:46 +00:00
parent c2a3cfc796
commit e2cb770b98
2 changed files with 15 additions and 3 deletions

View File

@ -29,6 +29,7 @@ import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ConfiguredRepositoryFactory; import org.apache.maven.archiva.configuration.ConfiguredRepositoryFactory;
import org.apache.maven.archiva.configuration.RepositoryConfiguration; import org.apache.maven.archiva.configuration.RepositoryConfiguration;
import org.apache.maven.archiva.discoverer.DiscovererStatistics; import org.apache.maven.archiva.discoverer.DiscovererStatistics;
import org.apache.maven.archiva.scheduler.executors.DataRefreshExecutor;
import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepository;
@ -44,6 +45,7 @@ import org.codehaus.plexus.registry.Registry;
import org.codehaus.plexus.registry.RegistryListener; import org.codehaus.plexus.registry.RegistryListener;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -305,9 +307,19 @@ public class DefaultActiveManagedRepositories
ArtifactRepository repository = (ArtifactRepository) i.next(); ArtifactRepository repository = (ArtifactRepository) i.next();
DiscovererStatistics stats = new DiscovererStatistics( repository ); DiscovererStatistics stats = new DiscovererStatistics( repository );
if ( stats.getTimestampFinished() > lastDataRefreshTime ) try
{ {
lastDataRefreshTime = stats.getTimestampFinished(); stats.load( DataRefreshExecutor.DATAREFRESH_FILE );
if ( stats.getTimestampFinished() > lastDataRefreshTime )
{
lastDataRefreshTime = stats.getTimestampFinished();
}
}
catch ( IOException e )
{
getLogger().info(
"Unable to load " + DataRefreshExecutor.DATAREFRESH_FILE
+ " to determine last refresh timestamp: " + e.getMessage(), e );
} }
} }

View File

@ -54,7 +54,7 @@ public class DataRefreshExecutor
extends AbstractLogEnabled extends AbstractLogEnabled
implements TaskExecutor implements TaskExecutor
{ {
private static final String DATAREFRESH_FILE = ".datarefresh"; public static final String DATAREFRESH_FILE = ".datarefresh";
/** /**
* Configuration store. * Configuration store.