Skip to content

Commit 18becb4

Browse files
committed
Run format
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 1dbfd6d commit 18becb4

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

java/src/org/openqa/selenium/grid/node/config/NodeFlags.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ public class NodeFlags implements HasRoles {
199199
public int registerPeriod = DEFAULT_REGISTER_PERIOD;
200200

201201
@Parameter(
202-
names = "--register-loopback",
202+
names = "--register-shutdown-on-failure",
203203
description =
204-
"If enable this flag, after register period is completed, the Node will shutdown itself."
204+
"If this flag is enabled, the Node will shut down after the register period is completed."
205205
+ " This is useful for container environments to restart and register again. If"
206-
+ " restart multiple times, Node container status will be CrashLoopBackOff.")
207-
@ConfigValue(section = NODE_SECTION, name = "register-loopback", example = "false")
208-
public boolean registerLoopBack = false;
206+
+ " restarted multiple times, the Node container status will be CrashLoopBackOff.")
207+
@ConfigValue(section = NODE_SECTION, name = "register-shutdown-on-failure", example = "false")
208+
public boolean registerShutdownOnFailure = false;
209209

210210
@Parameter(
211211
names = "--heartbeat-period",

java/src/org/openqa/selenium/grid/node/config/NodeOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ public Duration getRegisterPeriod() {
205205
return Duration.ofSeconds(seconds);
206206
}
207207

208-
public boolean getRegisterLoopBack() {
209-
return config.getBool(NODE_SECTION, "register-loopback").orElse(false);
208+
public boolean getRegisterShutdownOnFailure() {
209+
return config.getBool(NODE_SECTION, "register-shutdown-on-failure").orElse(false);
210210
}
211211

212212
public Duration getHeartbeatPeriod() {

java/src/org/openqa/selenium/grid/node/httpd/NodeServer.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,11 @@ public NettyServer start() {
219219
.onFailure(
220220
event -> {
221221
LOG.severe(
222-
String.format(
223-
"Registration event failed after period of %s seconds. Node will not attempt to register again.",
224-
nodeOptions.getRegisterPeriod().getSeconds()));
225-
if (nodeOptions.getRegisterLoopBack()) {
222+
String.format(
223+
"Registration event failed after period of %s seconds. Node will not"
224+
+ " attempt to register again",
225+
nodeOptions.getRegisterPeriod().getSeconds()));
226+
if (nodeOptions.getRegisterShutdownOnFailure()) {
226227
LOG.severe("Shutting down");
227228
System.exit(1);
228229
}

0 commit comments

Comments
 (0)