Skip to content

Commit

Permalink
Make ConnectivityOptions available to all commands.
Browse files Browse the repository at this point in the history
The BES, which uses ConnectivityModule, is available with all commands, so ConnectivityModule should be able to be initialized fully with all commands.

PiperOrigin-RevId: 249056921
  • Loading branch information
susinmotion authored and copybara-github committed May 20, 2019
1 parent 593f240 commit 3703a3d
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,12 @@ protected ConnectivityStatus determineConnectivity(String service, Cache<String,

@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().
Expand Down

0 comments on commit 3703a3d

Please sign in to comment.