]> source.dussan.org Git - archiva.git/commitdiff
no need to create etc.. if the index already exists
authorOlivier Lamy <olamy@apache.org>
Wed, 6 Feb 2013 22:49:25 +0000 (22:49 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 6 Feb 2013 22:49:25 +0000 (22:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1443258 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java

index c562e30229a6b243d5283f1b0dd462ac58b2da3b..0ecdb3724fd3b04b57e6d7b759105a22ed3a053d 100644 (file)
@@ -584,6 +584,14 @@ public class DefaultManagedRepositoryAdmin
         throws RepositoryAdminException
     {
 
+        IndexingContext context = indexer.getIndexingContexts().get( repository.getId() );
+
+        if ( context != null )
+        {
+            log.debug( "skip adding repository indexingContent with id {} as already exists", repository.getId() );
+            return context;
+        }
+
         // take care first about repository location as can be relative
         File repositoryDirectory = new File( repository.getLocation() );
 
@@ -602,13 +610,7 @@ public class DefaultManagedRepositoryAdmin
         try
         {
 
-            IndexingContext context = indexer.getIndexingContexts().get( repository.getId() );
 
-            if ( context != null )
-            {
-                log.debug( "skip adding repository indexingContent with id {} as already exists", repository.getId() );
-                return context;
-            }
 
             String indexDir = repository.getIndexDirectory();
             File managedRepository = new File( repository.getLocation() );
index 3441efa8aee1ff4b9c407a5054978642d69e37ad..a5197dcf5a0269a4469806d26ef0d683a0caf9c2 100644 (file)
@@ -91,7 +91,7 @@ public class ArchivaIndexingTaskExecutor
     }
 
     /**
-     * depending on current {@link Action} you have.
+     * depending on current {@link Task} you have.
      * If {@link org.apache.archiva.scheduler.indexing.ArtifactIndexingTask.Action.FINISH} && isExecuteOnEntireRepo:
      * repository will be scanned.
      *