mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
fix calculateWorkerId
This commit is contained in:
parent
58e4eec159
commit
5f8d71fc3f
@ -86,7 +86,7 @@ export class WorkerManager extends Map<number, Worker & { ready?: boolean }> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
calculateWorkerId(shardId: number) {
|
calculateWorkerId(shardId: number) {
|
||||||
const workerId = Math.floor(shardId / this.shardsPerWorker);
|
const workerId = Math.floor((shardId - this.options.shardStart) / this.shardsPerWorker);
|
||||||
if (workerId >= this.workers) {
|
if (workerId >= this.workers) {
|
||||||
throw new Error('Invalid shardId');
|
throw new Error('Invalid shardId');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user