]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5769 Switch from synchronous to asynchronous report analysis
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 4 Nov 2014 14:12:30 +0000 (15:12 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 4 Nov 2014 14:12:48 +0000 (15:12 +0100)
server/sonar-server/src/main/java/org/sonar/server/batch/UploadReportAction.java
server/sonar-server/src/main/java/org/sonar/server/computation/ComputationStepRegistry.java
sonar-core/src/main/java/org/sonar/core/computation/dbcleaner/DefaultPurgeTask.java

index 204fee1efa2cefee34b2660b9f1638acdf1b7348..276b0ce66cc102f4add3fc8d967b2d97141b8ad9 100644 (file)
@@ -25,7 +25,6 @@ import org.sonar.api.server.ws.RequestHandler;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
 import org.sonar.server.computation.AnalysisReportQueue;
-import org.sonar.server.computation.AnalysisReportTask;
 import org.sonar.server.computation.AnalysisReportTaskLauncher;
 import org.sonar.server.computation.ComputationService;
 
@@ -74,9 +73,6 @@ public class UploadReportAction implements RequestHandler {
 
     analysisReportQueue.add(projectKey, Long.valueOf(snapshotId));
 
-    // TODO remove synchronization as soon as it won't break ITs !
-    (new AnalysisReportTask(analysisReportQueue, computationService)).run();
-
     analysisTaskLauncher.startAnalysisTaskNow();
   }
 }
index 00c4d9859546159d0e410a2f8e51f0ad28b55b48..4362514650fad324fffb88dd1a6d7b14417f4de1 100644 (file)
@@ -38,12 +38,12 @@ public class ComputationStepRegistry implements ServerComponent {
 
   public List<ComputationStep> steps() {
     List<ComputationStep> steps = Lists.newArrayList();
-    steps.add(pico.getComponentByType(SynchronizeProjectPermissionsStep.class));
-    steps.add(pico.getComponentByType(SwitchSnapshotStep.class));
-    steps.add(pico.getComponentByType(InvalidatePreviewCacheStep.class));
-    steps.add(pico.getComponentByType(ComponentIndexationInDatabaseStep.class));
-    steps.add(pico.getComponentByType(DataCleanerStep.class));
-    steps.add(pico.getComponentByType(IndexProjectIssuesStep.class));
+    steps.add(pico.getComponentByType(SynchronizeProjectPermissionsStep.class)); // project only
+    steps.add(pico.getComponentByType(SwitchSnapshotStep.class)); // project & views
+    steps.add(pico.getComponentByType(InvalidatePreviewCacheStep.class)); // project only
+    steps.add(pico.getComponentByType(ComponentIndexationInDatabaseStep.class)); // project & views
+    steps.add(pico.getComponentByType(DataCleanerStep.class)); // project & views
+    steps.add(pico.getComponentByType(IndexProjectIssuesStep.class)); // project only
 
     return ImmutableList.copyOf(steps);
   }
index 63957a0a7f6a822c0cfe508955cf4a3130137ea2..5f31b775f5c50cacaffc21f3f9b140939dd24929 100644 (file)
@@ -84,7 +84,7 @@ public class DefaultPurgeTask implements PurgeTask {
     try {
       purgeDao.purge(newPurgeConfigurationOnResource(resourceId));
     } catch (Exception e) {
-      // purge errors must no fail the batch
+      // purge errors must no fail the report analysis
       LOG.error("Fail to purge data [id=" + resourceId + "]", e);
     }
   }