fix(ShardingManager): respawnAll shard iteration

This commit is contained in:
Lewdcario
2018-07-10 21:39:58 -05:00
parent 526832058e
commit f67d682223

View File

@@ -194,7 +194,7 @@ class ShardingManager extends EventEmitter {
*/
async respawnAll(shardDelay = 5000, respawnDelay = 500, waitForReady = true) {
let s = 0;
for (const shard of this.shards) {
for (const shard of this.shards.values()) {
const promises = [shard.respawn(respawnDelay, waitForReady)];
if (++s < this.shards.size && shardDelay > 0) promises.push(Util.delayFor(shardDelay));
await Promise.all(promises); // eslint-disable-line no-await-in-loop