]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12251 commit each processed project in PopulateLiveMeasures
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 2 Jul 2019 07:59:59 +0000 (09:59 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 30 Jul 2019 18:24:26 +0000 (20:24 +0200)
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v70/PopulateLiveMeasures.java

index 2ad1464d4a14fe536a7ff6cdb581d3541bdb7480..cb3d0d3b67d2b2de49ae502fb79e180a32616378 100644 (file)
@@ -96,7 +96,9 @@ public class PopulateLiveMeasures extends DataChange {
       "   (uuid, component_uuid, project_uuid, metric_id, value, text_value, variation, measure_data, created_at, updated_at)" +
       " values" +
       "   (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
-    massUpdate.update("insert into live_measures_p (project_uuid) values (?)");
+    massUpdate.update("insert into live_measures_p (project_uuid) values (?)")
+      // we want to commit each project finished asap to avoid restarting them over in case of interruption
+      .setBatchSize(1);
     LiveMeasurePopulationMultiHandler handler = new LiveMeasurePopulationMultiHandler(firstAttempt, rows, now);
     massUpdate.execute(handler);