]> source.dussan.org Git - sonarqube.git/commitdiff
Async replication of activity docs
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 4 Mar 2015 09:41:15 +0000 (10:41 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 4 Mar 2015 09:41:15 +0000 (10:41 +0100)
server/sonar-server/src/main/java/org/sonar/server/activity/index/ActivityIndexer.java

index 1a668bd5a8f94f2bc185368ee4a66798f7011ec7..2b4ba6e678e8d854bf64fc0275a520ffb225bba8 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.sonar.server.activity.index;
 
+import org.elasticsearch.action.support.replication.ReplicationType;
 import org.elasticsearch.action.update.UpdateRequest;
 import org.sonar.core.persistence.DbSession;
 import org.sonar.server.db.DbClient;
@@ -84,6 +85,7 @@ public class ActivityIndexer extends BaseIndexer {
   private UpdateRequest newUpsertRequest(ActivityDoc doc) {
     return new UpdateRequest(ActivityIndexDefinition.INDEX, ActivityIndexDefinition.TYPE, doc.getKey())
       .doc(doc.getFields())
-      .upsert(doc.getFields());
+      .upsert(doc.getFields())
+      .replicationType(ReplicationType.ASYNC);
   }
 }