Skip to content

Commit

Permalink
fix(ShardingManager): respawnAll shard iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewdcario committed Jul 11, 2018
1 parent 5268320 commit f67d682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sharding/ShardingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f67d682

Please sign in to comment.