fix: load order bug

This commit is contained in:
Skillz4Killz
2021-12-16 15:57:26 +00:00
committed by GitHub
parent 470a4a6443
commit c9be91a967

View File

@@ -42,13 +42,12 @@ export function spawnShards(gateway: GatewayManager, firstShardId = 0) {
for (const [workerId, ...queue] of bucket.workers) {
gateway.debug(`3. Running for of loop in spawnShards function.`);
queue.forEach((shardId) => {
for (const shardId of queue) {
bucket.createNextShard.push(async () => {
await gateway.tellWorkerToIdentify(gateway, workerId, shardId, bucketId);
});
});
await bucket.createNextShard.shift()?.();
}
}
await bucket.createNextShard.shift()?.();
});
}