Merge "Add config option to reindex all groups on slave startup"

This commit is contained in:
Edwin Kempin
2018-02-21 12:11:07 +00:00
committed by Gerrit Code Review
4 changed files with 45 additions and 5 deletions

View File

@@ -343,9 +343,6 @@ public abstract class AbstractDaemonTest {
server.getTestInjector().injectMembers(resetter);
}
initSsh();
// The server restart threw away all indices. Only reindex all groups as we only have the group
// index in slave mode.
reindexAllGroups();
}
private void reindexAllGroups() throws OrmException, IOException, ConfigInvalidException {

View File

@@ -82,6 +82,11 @@ public class PeriodicGroupIndexer implements Runnable {
@Override
public void start() {
boolean runOnStartup = cfg.getBoolean("index", "scheduledIndexer", "runOnStartup", true);
if (runOnStartup) {
runner.run();
}
boolean isEnabled = cfg.getBoolean("index", "scheduledIndexer", "enabled", true);
if (!isEnabled) {
log.warn("index.scheduledIndexer is disabled");