mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: final shard bug not starting up
This commit is contained in:
@@ -12,7 +12,7 @@ export function prepareBuckets(gateway: GatewayManager, firstShardId: number, la
|
||||
}
|
||||
|
||||
// ORGANIZE ALL SHARDS INTO THEIR OWN BUCKETS
|
||||
for (let i = firstShardId; i < lastShardId; i++) {
|
||||
for (let i = firstShardId; i <= lastShardId; i++) {
|
||||
gateway.debug("GW DEBUG", `1. Running for loop in spawnShards function for shardId ${i}.`);
|
||||
if (i >= gateway.maxShards) {
|
||||
continue;
|
||||
@@ -45,8 +45,9 @@ export function spawnShards(gateway: GatewayManager, firstShardId = 0) {
|
||||
}
|
||||
|
||||
// PREPARES ALL SHARDS IN SPECIFIC BUCKETS
|
||||
prepareBuckets(gateway, firstShardId, gateway.lastShardId ? gateway.lastShardId : gateway.maxShards);
|
||||
prepareBuckets(gateway, firstShardId, gateway.lastShardId ? gateway.lastShardId : gateway.maxShards - 1);
|
||||
|
||||
console.log(gateway.buckets.first());
|
||||
// SPREAD THIS OUT TO DIFFERENT WORKERS TO BEGIN STARTING UP
|
||||
gateway.buckets.forEach(async (bucket, bucketId) => {
|
||||
gateway.debug("GW DEBUG", `2. Running forEach loop in spawnShards function.`);
|
||||
|
||||
Reference in New Issue
Block a user