|
35 | 35 | import org.openqa.selenium.grid.data.Availability;
|
36 | 36 | import org.openqa.selenium.grid.data.CreateSessionRequest;
|
37 | 37 | import org.openqa.selenium.grid.data.CreateSessionResponse;
|
38 |
| -import org.openqa.selenium.grid.data.NodeAddedEvent; |
39 | 38 | import org.openqa.selenium.grid.data.NodeDrainComplete;
|
40 | 39 | import org.openqa.selenium.grid.data.NodeDrainStarted;
|
41 | 40 | import org.openqa.selenium.grid.data.NodeHeartBeatEvent;
|
@@ -116,7 +115,6 @@ public class LocalNode extends Node {
|
116 | 115 | private final Cache<SessionId, TemporaryFilesystem> tempFileSystems;
|
117 | 116 | private final Regularly regularly;
|
118 | 117 | private final AtomicInteger pendingSessions = new AtomicInteger();
|
119 |
| - private final AtomicBoolean heartBeatStarted = new AtomicBoolean(false); |
120 | 118 |
|
121 | 119 | private LocalNode(
|
122 | 120 | Tracer tracer,
|
@@ -173,15 +171,7 @@ private LocalNode(
|
173 | 171 | this.regularly = new Regularly("Local Node: " + externalUri);
|
174 | 172 | regularly.submit(currentSessions::cleanUp, Duration.ofSeconds(30), Duration.ofSeconds(30));
|
175 | 173 | regularly.submit(tempFileSystems::cleanUp, Duration.ofSeconds(30), Duration.ofSeconds(30));
|
176 |
| - bus.addListener(NodeAddedEvent.listener(nodeId -> { |
177 |
| - if (getId().equals(nodeId)) { |
178 |
| - // Lets avoid to create more than one "Regularly" when the Node registers again. |
179 |
| - if (!heartBeatStarted.getAndSet(true)) { |
180 |
| - regularly.submit( |
181 |
| - () -> bus.fire(new NodeHeartBeatEvent(getStatus())), heartbeatPeriod, heartbeatPeriod); |
182 |
| - } |
183 |
| - } |
184 |
| - })); |
| 174 | + regularly.submit(() -> bus.fire(new NodeHeartBeatEvent(getStatus())), heartbeatPeriod, heartbeatPeriod); |
185 | 175 |
|
186 | 176 | bus.addListener(SessionClosedEvent.listener(id -> {
|
187 | 177 | try {
|
|
0 commit comments