mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 12:34:42 +12:00
fix(WebSocketShard): wait a little before reconnecting (#9517)
* fix(WebSocketShard): wait a little before reconnecting * chore: leftover comment --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
parent
ab39683a50
commit
00da44a120
2 changed files with 3 additions and 1 deletions
|
@ -229,7 +229,6 @@ test('strategies', async () => {
|
|||
await manager.destroy(destroyOptions);
|
||||
expect(strategy.destroy).toHaveBeenCalledWith(destroyOptions);
|
||||
|
||||
// eslint-disable-next-line id-length
|
||||
const send: GatewaySendPayload = {
|
||||
op: GatewayOpcodes.RequestGuildMembers,
|
||||
// eslint-disable-next-line id-length
|
||||
|
|
|
@ -259,6 +259,9 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
|
|||
this.#status = WebSocketShardStatus.Idle;
|
||||
|
||||
if (options.recover !== undefined) {
|
||||
// There's cases (like no internet connection) where we immediately fail to connect,
|
||||
// causing a very fast and draining reconnection loop.
|
||||
await sleep(500);
|
||||
return this.internalConnect();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue