mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 09:13:22 +00: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:
parent
5e9bd786d1
commit
bfab203934
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue