DiscordClient: add logging for lack of heartbeat ACK
This commit is contained in:
parent
b9c25ec3e6
commit
7329570cb7
1 changed files with 8 additions and 0 deletions
|
@ -49,6 +49,7 @@ class DiscordClient extends EventEmitter {
|
||||||
|
|
||||||
this._heartbeatInterval = setInterval(() => {
|
this._heartbeatInterval = setInterval(() => {
|
||||||
if (!this.gotServerHeartbeatACK) {
|
if (!this.gotServerHeartbeatACK) {
|
||||||
|
logError("Closing due to no heartbeat ACK...");
|
||||||
this.ws.close(1000, "No heartbeat ACK.");
|
this.ws.close(1000, "No heartbeat ACK.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -227,6 +228,13 @@ class DiscordClient extends EventEmitter {
|
||||||
this.ws = null;
|
this.ws = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!this.__init) {
|
||||||
|
this.__init = true;
|
||||||
|
this.ws.close();
|
||||||
|
}
|
||||||
|
}, 6000)
|
||||||
|
|
||||||
const ws = new WebSocket(this.gatewayUrl);
|
const ws = new WebSocket(this.gatewayUrl);
|
||||||
|
|
||||||
this.ws = ws;
|
this.ws = ws;
|
||||||
|
|
Loading…
Reference in a new issue