mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix(gateway): wrong calculation in calculateWorkerId() (#4096)
* Update manager.ts Fix wrong calculation of workerId * Update manager.ts * spread incrementally * fix usage of incorrect variable --------- Co-authored-by: Awesome Stickz <awesome@stickz.dev>
This commit is contained in:
co-authored by
Awesome Stickz
parent
10731a180a
commit
153408f286
@@ -271,7 +271,7 @@ export function createGatewayManager(options: CreateGatewayManagerOptions): Gate
|
||||
)
|
||||
},
|
||||
calculateWorkerId(shardId) {
|
||||
const workerId = Math.min(shardId % gateway.shardsPerWorker, gateway.totalWorkers - 1)
|
||||
const workerId = Math.min(Math.floor(shardId / gateway.shardsPerWorker), gateway.totalWorkers - 1);
|
||||
gateway.logger.debug(
|
||||
`[Gateway] Calculating workerId: Shard: ${shardId} -> Worker: ${workerId} -> Per Worker: ${gateway.shardsPerWorker} -> Total: ${gateway.totalWorkers}`,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user