mirror of
https://github.com/danbulant/discord.js
synced 2026-06-06 16:22:08 +00:00
src: fix random broken reconnects (#3233)
This commit is contained in:
parent
de79bba965
commit
577636a46d
1 changed files with 4 additions and 0 deletions
|
|
@ -311,11 +311,15 @@ class WebSocketShard extends EventEmitter {
|
||||||
onClose(event) {
|
onClose(event) {
|
||||||
this.closeSequence = this.sequence;
|
this.closeSequence = this.sequence;
|
||||||
this.sequence = -1;
|
this.sequence = -1;
|
||||||
|
|
||||||
this.debug(`WebSocket was closed.
|
this.debug(`WebSocket was closed.
|
||||||
Event Code: ${event.code}
|
Event Code: ${event.code}
|
||||||
Clean: ${event.wasClean}
|
Clean: ${event.wasClean}
|
||||||
Reason: ${event.reason || 'No reason received'}`);
|
Reason: ${event.reason || 'No reason received'}`);
|
||||||
|
|
||||||
|
this.setHeartbeatTimer(-1);
|
||||||
|
this.setHelloTimeout(-1);
|
||||||
|
|
||||||
this.status = Status.DISCONNECTED;
|
this.status = Status.DISCONNECTED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue