fix calculateWorkerId

This commit is contained in:
MARCROCK22 2024-03-13 21:42:03 -04:00
parent 58e4eec159
commit 5f8d71fc3f

View File

@ -86,7 +86,7 @@ export class WorkerManager extends Map<number, Worker & { ready?: boolean }> {
}
calculateWorkerId(shardId: number) {
const workerId = Math.floor(shardId / this.shardsPerWorker);
const workerId = Math.floor((shardId - this.options.shardStart) / this.shardsPerWorker);
if (workerId >= this.workers) {
throw new Error('Invalid shardId');
}