]> source.dussan.org Git - archiva.git/commitdiff
re-order test
authorBrett Porter <brett@apache.org>
Fri, 1 Aug 2014 04:20:56 +0000 (14:20 +1000)
committerBrett Porter <brett@apache.org>
Fri, 1 Aug 2014 04:20:56 +0000 (14:20 +1000)
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java

index f69d5662799101a26667b763c072a1e5ecdc2db7..dae631306b6f20bb56944e6b862108726f74d746 100644 (file)
@@ -170,6 +170,11 @@ public class DefaultRepositoriesService
     @Override
     public Boolean alreadyScanning( String repositoryId )
     {
+        // check queue first to make sure it doesn't get dequeued between calls
+        if ( repositoryTaskScheduler.isProcessingRepositoryTask( repositoryId ) )
+        {
+            return true;
+        }
         for ( RepositoryScannerInstance scan : repoScanner.getInProgressScans() )
         {
             if ( scan.getRepository().getId().equals( repositoryId ) )
@@ -177,7 +182,7 @@ public class DefaultRepositoriesService
                 return true;
             }
         }
-        return repositoryTaskScheduler.isProcessingRepositoryTask( repositoryId );
+        return false;
     }
 
     @Override