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.
PiperOrigin-RevId: 249056921
diff --git a/src/main/java/com/google/devtools/build/lib/network/ConnectivityModule.java b/src/main/java/com/google/devtools/build/lib/network/ConnectivityModule.java
index 21e0f5c..85343b8 100644
--- a/src/main/java/com/google/devtools/build/lib/network/ConnectivityModule.java
+++ b/src/main/java/com/google/devtools/build/lib/network/ConnectivityModule.java
@@ -63,17 +63,12 @@
@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().