Honor --slave and --headless options better
Looks like serving PolyGerrit UI never honored the --headless option. In addition, the StaticModule was unnecessarily installed when running in the slave mode. Don't install the StaticModule when running in the slave mode. Don't serve PolyGerrit UI when running in the headless mode. Change-Id: I480a9c33d596feba4516028491684832785b8dc4
This commit is contained in:
parent
ba0639b379
commit
90719e2ac6
@ -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);
|
||||
}
|
||||
|
@ -137,9 +137,8 @@ public class StaticModule extends ServletModule {
|
||||
});
|
||||
if (!options.headless()) {
|
||||
install(new CoreStaticModule());
|
||||
install(new PolyGerritModule());
|
||||
}
|
||||
|
||||
install(new PolyGerritModule());
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user