|
18 | 18 | package org.openqa.grid.internal.utils;
|
19 | 19 |
|
20 | 20 | import static org.openqa.grid.common.RegistrationRequest.AUTO_REGISTER;
|
| 21 | +import static org.openqa.grid.internal.utils.ServerJsonValues.BROWSER_TIMEOUT; |
| 22 | +import static org.openqa.grid.internal.utils.ServerJsonValues.CLIENT_TIMEOUT; |
21 | 23 |
|
22 | 24 | import com.google.gson.JsonArray;
|
23 | 25 | import com.google.gson.JsonObject;
|
|
53 | 55 | import java.util.Arrays;
|
54 | 56 | import java.util.List;
|
55 | 57 | import java.util.Map;
|
56 |
| -import java.util.logging.Level; |
57 | 58 | import java.util.logging.Logger;
|
58 | 59 |
|
59 | 60 | import javax.servlet.Servlet;
|
@@ -94,18 +95,16 @@ public void startRemoteServer() throws Exception {
|
94 | 95 | RemoteControlConfiguration remoteControlConfiguration = nodeConfig.getRemoteControlConfiguration();
|
95 | 96 |
|
96 | 97 | try {
|
97 |
| - final String CLIENT_TIMEOUT = "timeout"; |
98 |
| - final String BROWSER_TIMEOUT = "browserTimeout"; |
99 | 98 | JsonObject hubParameters = getHubConfiguration();
|
100 |
| - if (hubParameters.has(CLIENT_TIMEOUT)){ |
101 |
| - int timeout = hubParameters.get(CLIENT_TIMEOUT).getAsInt() / 1000; |
| 99 | + if (hubParameters.has(CLIENT_TIMEOUT.getKey())){ |
| 100 | + int timeout = hubParameters.get(CLIENT_TIMEOUT.getKey()).getAsInt() / 1000; |
102 | 101 | remoteControlConfiguration.setTimeoutInSeconds(timeout);
|
103 | 102 | }
|
104 |
| - if (hubParameters.has(BROWSER_TIMEOUT)) { |
105 |
| - int browserTimeout = hubParameters.get(BROWSER_TIMEOUT).getAsInt(); |
| 103 | + if (hubParameters.has(BROWSER_TIMEOUT.getKey())) { |
| 104 | + int browserTimeout = hubParameters.get(BROWSER_TIMEOUT.getKey()).getAsInt(); |
106 | 105 | remoteControlConfiguration.setBrowserTimeoutInMs(browserTimeout);
|
107 | 106 | }
|
108 |
| - }catch (Exception e) { |
| 107 | + } catch (Exception e) { |
109 | 108 | LOG.warning(
|
110 | 109 | "error getting the parameters from the hub. The node may end up with wrong timeouts." + e
|
111 | 110 | .getMessage());
|
|
0 commit comments