mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 17:21:31 +00:00
fix(ShardingManager): respawnAll shard iteration
This commit is contained in:
parent
526832058e
commit
f67d682223
1 changed files with 1 additions and 1 deletions
|
|
@ -194,7 +194,7 @@ class ShardingManager extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
async respawnAll(shardDelay = 5000, respawnDelay = 500, waitForReady = true) {
|
async respawnAll(shardDelay = 5000, respawnDelay = 500, waitForReady = true) {
|
||||||
let s = 0;
|
let s = 0;
|
||||||
for (const shard of this.shards) {
|
for (const shard of this.shards.values()) {
|
||||||
const promises = [shard.respawn(respawnDelay, waitForReady)];
|
const promises = [shard.respawn(respawnDelay, waitForReady)];
|
||||||
if (++s < this.shards.size && shardDelay > 0) promises.push(Util.delayFor(shardDelay));
|
if (++s < this.shards.size && shardDelay > 0) promises.push(Util.delayFor(shardDelay));
|
||||||
await Promise.all(promises); // eslint-disable-line no-await-in-loop
|
await Promise.all(promises); // eslint-disable-line no-await-in-loop
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue