diff options
author | Olivier Lamy <olamy@apache.org> | 2013-12-17 07:29:31 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-12-17 07:29:31 +0000 |
commit | 1e1f7cdacd0118a5fb9a707871c7b7100b7f09d2 (patch) | |
tree | 1f1750f62f31b10b5cd1cb0b9ed96eeed848c823 /archiva-modules/archiva-base/archiva-indexer | |
parent | 3ac4f6e6624968f11d6293ac17244e1275ab1305 (diff) | |
download | archiva-1e1f7cdacd0118a5fb9a707871c7b7100b7f09d2.tar.gz archiva-1e1f7cdacd0118a5fb9a707871c7b7100b7f09d2.zip |
[MRM-1746] build merged index for groups with a cron schedule
fix issues
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1551475 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-indexer')
-rw-r--r-- | archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultMergedRemoteIndexesScheduler.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultMergedRemoteIndexesScheduler.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultMergedRemoteIndexesScheduler.java index 480529b44..776253d99 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultMergedRemoteIndexesScheduler.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultMergedRemoteIndexesScheduler.java @@ -22,6 +22,7 @@ package org.apache.archiva.indexer.merger; import org.apache.archiva.admin.model.beans.RepositoryGroup; import org.apache.archiva.admin.model.group.RepositoryGroupAdmin; import org.apache.archiva.scheduler.MergedRemoteIndexesScheduler; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.TaskScheduler; @@ -52,24 +53,19 @@ public class DefaultMergedRemoteIndexesScheduler private TaskScheduler taskScheduler; @Inject - private RepositoryGroupAdmin repositoryGroupAdmin; - - @Inject private IndexMerger indexMerger; private Map<String, ScheduledFuture> scheduledFutureMap = new ConcurrentHashMap<String, ScheduledFuture>(); @Override - public void schedule( RepositoryGroup repositoryGroup ) + public void schedule( RepositoryGroup repositoryGroup, File directory ) { - if ( repositoryGroup.getCronExpression() == null ) + if ( StringUtils.isEmpty( repositoryGroup.getCronExpression() ) ) { return; } CronTrigger cronTrigger = new CronTrigger( repositoryGroup.getCronExpression() ); - File directory = repositoryGroupAdmin.getMergedIndexDirectory( repositoryGroup.getId() ); - List<String> repositories = repositoryGroup.getRepositories(); IndexMergerRequest indexMergerRequest = @@ -79,6 +75,9 @@ public class DefaultMergedRemoteIndexesScheduler MergedRemoteIndexesTaskRequest taskRequest = new MergedRemoteIndexesTaskRequest( indexMergerRequest, indexMerger ); + logger.info( "schedule merge remote index for group {} with cron {}", repositoryGroup.getId(), + repositoryGroup.getCronExpression() ); + ScheduledFuture scheduledFuture = taskScheduler.schedule( new MergedRemoteIndexesTask( taskRequest ), cronTrigger ); scheduledFutureMap.put( repositoryGroup.getId(), scheduledFuture ); |