summaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-03-04 23:52:29 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-03-04 23:52:29 +0100
commit0fa0dd19538e28421b2da7220da388be7e950788 (patch)
tree59d63ce45536e02b37c40919638fd3e3f242ddef /server/sonar-server
parent6108a50f766dac17b0bd45258c70ffd346d366c1 (diff)
downloadsonarqube-0fa0dd19538e28421b2da7220da388be7e950788.tar.gz
sonarqube-0fa0dd19538e28421b2da7220da388be7e950788.zip
SONAR-6229 fix indexing of active rules
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();