Daemon: Don't add index commands when running as slave

Bug: Issue 3694
Change-Id: I3c50269452d9599b74044014090a30e134b3b6ec
This commit is contained in:
David Pursehouse
2015-11-25 13:25:28 +09:00
parent bee87af4be
commit 22310ffbab

View File

@@ -278,7 +278,9 @@ public class Daemon extends SiteProgram {
cfgInjector = createCfgInjector();
config = cfgInjector.getInstance(
Key.get(Config.class, GerritServerConfig.class));
initIndexType();
if (!slave) {
initIndexType();
}
sysInjector = createSysInjector();
sysInjector.getInstance(PluginGuiceEnvironment.class)
.setDbCfgInjector(dbInjector, cfgInjector);
@@ -415,7 +417,7 @@ public class Daemon extends SiteProgram {
}
modules.add(new DefaultCommandModule(slave,
sysInjector.getInstance(DownloadConfig.class)));
if (indexType == IndexType.LUCENE) {
if (!slave && indexType == IndexType.LUCENE) {
modules.add(new IndexCommandsModule());
}
return sysInjector.createChildInjector(modules);