mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 07:24:53 +09:00
Fix reconnect giving up too early
Fix the reconnect logic giving immediately if a previous reconnection had been made long prior to the connection being dropped again.
This commit is contained in:
1 parent
d2fb33f8b9
commit
b6585e6364
1 file changed
+2
@@ -351,6 +351,7 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
|
||||
this._sessionToken = data.session_token;
|
||||
this._heartbeatInterval = data.heartbeat_interval;
|
||||
this.startHeartbeat();
|
||||
this._startedReconnect = null;
|
||||
this._connected = true;
|
||||
this.emit("connected");
|
||||
|
||||
@@ -363,6 +364,7 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
|
||||
for (let message of this._sendBuffer) {
|
||||
this._socket.send(JSON.stringify(message));
|
||||
}
|
||||
this._startedReconnect = null;
|
||||
this._connected = true;
|
||||
this.emit("connected");
|
||||
|
||||
|
||||
Reference in new issue
Block a user