Make ConnectivityOptions available to all commands.
The BES, which uses ConnectivityModule, is available with all commands, so ConnectivityModule should be able to be initialized fully with all commands.
@@ -63,17 +63,12 @@ public class ConnectivityModule extends BlazeModule implements ConnectivityStatu
@Override
public Iterable<Class<? extends OptionsBase>> getCommandOptions(Command command) {
- return "build".equals(command.name())
- ? ImmutableList.of(ConnectivityOptions.class)
- : ImmutableList.of();
+ return ImmutableList.of(ConnectivityOptions.class);
}
@Override
public void beforeCommand(CommandEnvironment env) throws AbruptExitException {
ConnectivityOptions options = env.getOptions().getOptions(ConnectivityOptions.class);
- if (options == null) {
- return;
- }
Duration newCacheLifetime = options.cacheLifetime;
// Initialize the cache if we haven't yet, or if the options have changed.
// TODO(steinman): Make this a LoadingCache where load() calls determineConnectivity().
