mirror of https://github.com/apache/archiva.git
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:
parent
c2a3cfc796
commit
e2cb770b98
|
@ -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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue