diff options
author | 2018-02-06 07:32:07 -0800 | |
---|---|---|
committer | 2018-02-06 07:34:15 -0800 | |
commit | 92125f8ea1963b31efcc486d4fa721d26734b9ab (patch) | |
tree | 3341750a5360885f5164e57d054c249fb8cf31d9 /src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java | |
parent | 93b329417bba4ac4860628ebefc9fc64faec8cdf (diff) |
Remove ShutdownBlazeServerException in favor of indicating that the server should be shut down in BlazeCommandResult.
RELNOTES: None.
PiperOrigin-RevId: 184678994
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java index f242c9d7ce..4808b39b24 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/ShutdownCommand.java @@ -14,7 +14,6 @@ package com.google.devtools.build.lib.runtime.commands; import com.google.devtools.build.lib.runtime.BlazeCommand; -import com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.ShutdownBlazeServerException; import com.google.devtools.build.lib.runtime.BlazeCommandResult; import com.google.devtools.build.lib.runtime.Command; import com.google.devtools.build.lib.runtime.CommandEnvironment; @@ -57,8 +56,7 @@ public final class ShutdownCommand implements BlazeCommand { public void editOptions(OptionsParser optionsParser) {} @Override - public BlazeCommandResult exec(CommandEnvironment env, OptionsProvider options) - throws ShutdownBlazeServerException { + public BlazeCommandResult exec(CommandEnvironment env, OptionsProvider options) { int limit = options.getOptions(Options.class).heapSizeLimit; // Iff limit is non-zero, shut down the server if total memory exceeds the @@ -70,8 +68,9 @@ public final class ShutdownCommand implements BlazeCommand { if (limit == 0 || Runtime.getRuntime().totalMemory() > limit * 1000L * 1000) { - throw new ShutdownBlazeServerException(ExitCode.SUCCESS); + return BlazeCommandResult.shutdown(ExitCode.SUCCESS); } + return BlazeCommandResult.exitCode(ExitCode.SUCCESS); } |