mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
fix(ShardingManager): do not spawn the last shard early
An off-by-one error resulted in the last shard getting the delay of the second last one. Closes #3181
This commit is contained in:
@@ -194,7 +194,7 @@ class ShardingManager extends EventEmitter {
|
|||||||
const promises = [];
|
const promises = [];
|
||||||
const shard = this.createShard(shardID);
|
const shard = this.createShard(shardID);
|
||||||
promises.push(shard.spawn(waitForReady));
|
promises.push(shard.spawn(waitForReady));
|
||||||
if (delay > 0 && this.shards.size !== this.shardList.length - 1) promises.push(Util.delayFor(delay));
|
if (delay > 0 && this.shards.size !== this.shardList.length) promises.push(Util.delayFor(delay));
|
||||||
await Promise.all(promises); // eslint-disable-line no-await-in-loop
|
await Promise.all(promises); // eslint-disable-line no-await-in-loop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user