summaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java1
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/search/IndexSynchronizer.java4
2 files changed, 4 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java
index 66c8d2ff0ec..1c03d4fb89c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java
@@ -847,6 +847,7 @@ class ServerComponents {
DoPrivileged.execute(new DoPrivileged.Task() {
@Override
protected void doPrivileged() {
+ startupContainer.getComponentByType(IndexSynchronizer.class).executeDeprecated();
startupContainer.startComponents();
startupContainer.getComponentByType(IndexSynchronizer.class).execute();
startupContainer.getComponentByType(ServerLifecycleNotifier.class).notifyStart();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/IndexSynchronizer.java b/server/sonar-server/src/main/java/org/sonar/server/search/IndexSynchronizer.java
index 6e0a4dca98a..95bafedf6ee 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/search/IndexSynchronizer.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/search/IndexSynchronizer.java
@@ -67,7 +67,7 @@ public class IndexSynchronizer {
this.activityIndexer = activityIndexer;
}
- public void execute() {
+ public void executeDeprecated() {
DbSession session = db.openSession(false);
try {
synchronize(session, db.ruleDao(), index.get(RuleIndex.class));
@@ -76,7 +76,9 @@ public class IndexSynchronizer {
} finally {
session.close();
}
+ }
+ public void execute() {
LOG.info("Index activities");
activityIndexer.setEnabled(true).index();