Merge "Honor --slave and --headless options better"

This commit is contained in:
Saša Živkov 2018-11-20 08:41:47 +00:00 committed by Gerrit Code Review
commit 61bd3104dd
3 changed files with 9 additions and 4 deletions

View File

@ -443,7 +443,10 @@ public class WebAppInitializer extends GuiceServletContextListener implements Fi
modules.add(sysInjector.getInstance(GetUserFilter.Module.class));
// StaticModule contains a "/*" wildcard, place it last.
modules.add(sysInjector.getInstance(StaticModule.class));
GerritOptions opts = sysInjector.getInstance(GerritOptions.class);
if (opts.enableMasterFeatures()) {
modules.add(sysInjector.getInstance(StaticModule.class));
}
return sysInjector.createChildInjector(modules);
}

View File

@ -137,9 +137,8 @@ public class StaticModule extends ServletModule {
});
if (!options.headless()) {
install(new CoreStaticModule());
install(new PolyGerritModule());
}
install(new PolyGerritModule());
}
@Provides

View File

@ -611,7 +611,10 @@ public class Daemon extends SiteProgram {
modules.add(sysInjector.getInstance(GetUserFilter.Module.class));
// StaticModule contains a "/*" wildcard, place it last.
modules.add(sysInjector.getInstance(StaticModule.class));
GerritOptions opts = sysInjector.getInstance(GerritOptions.class);
if (opts.enableMasterFeatures()) {
modules.add(sysInjector.getInstance(StaticModule.class));
}
return sysInjector.createChildInjector(modules);
}