From 7de0b077cfac6c5555129e6d81e733d2cae3efd8 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 4 May 2016 15:22:47 +0200 Subject: [PATCH] Remove useless parameter refresh --- .../org/sonar/server/component/ComponentCleanerService.java | 4 ++-- .../main/java/org/sonar/server/issue/index/IssueIndexer.java | 4 ++-- .../java/org/sonar/server/issue/index/IssueIndexerTest.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentCleanerService.java b/server/sonar-server/src/main/java/org/sonar/server/component/ComponentCleanerService.java index 8d75008845b..4026a58147c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ComponentCleanerService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ComponentCleanerService.java @@ -20,10 +20,10 @@ package org.sonar.server.component; import java.util.List; +import org.sonar.api.ce.ComputeEngineSide; import org.sonar.api.resources.ResourceType; import org.sonar.api.resources.ResourceTypes; import org.sonar.api.resources.Scopes; -import org.sonar.api.ce.ComputeEngineSide; import org.sonar.api.server.ServerSide; import org.sonar.db.DbClient; import org.sonar.db.DbSession; @@ -83,7 +83,7 @@ public class ComponentCleanerService { private void deleteFromIndices(String projectUuid) { // optimization : index "issues" is refreshed once at the end issueAuthorizationIndexer.deleteProject(projectUuid, false); - issueIndexer.deleteProject(projectUuid, true); + issueIndexer.deleteProject(projectUuid); testIndexer.deleteByProject(projectUuid); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndexer.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndexer.java index 73b68a4a43e..97e747ec8a7 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndexer.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndexer.java @@ -101,9 +101,9 @@ public class IssueIndexer extends BaseIndexer { return maxDate; } - public void deleteProject(String uuid, boolean refresh) { + public void deleteProject(String uuid) { BulkIndexer bulk = new BulkIndexer(esClient, INDEX); - bulk.setDisableRefresh(!refresh); + bulk.setDisableRefresh(false); bulk.start(); SearchRequestBuilder search = esClient.prepareSearch(INDEX) .setRouting(uuid) diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java index e10d2c82252..81e46971b41 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java @@ -106,7 +106,7 @@ public class IssueIndexerTest { assertThat(esTester.countDocuments("issues", "issue")).isEqualTo(1); - indexer.deleteProject("THE_PROJECT", true); + indexer.deleteProject("THE_PROJECT"); assertThat(esTester.countDocuments("issues", "issue")).isZero(); } -- 2.39.5