mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
src: fix random broken reconnects (#3233)
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user