From 0fa0dd19538e28421b2da7220da388be7e950788 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 4 Mar 2015 23:52:29 +0100 Subject: [PATCH] SONAR-6229 fix indexing of active rules --- .../main/java/org/sonar/server/platform/ServerComponents.java | 1 + .../main/java/org/sonar/server/search/IndexSynchronizer.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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(); -- 2.39.5