X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fworker-node.ts;h=6a5881da097bbbd727806a024edf9c6ab06eb7c3;hb=refs%2Ftags%2Fv3.1.13;hp=bf2600d57782873bea28f50f413a7de945a35b35;hpb=d35e571704515a8b729d3455e4784054f07c368f;p=poolifier.git diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index bf2600d5..6a5881da 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -80,7 +80,8 @@ export class WorkerNode const tasksQueueSize = this.tasksQueue.push(task) if (this.hasBackPressure() && !this.onBackPressureStarted) { this.onBackPressureStarted = true - this.emit('backPressure', { workerId: this.info.id as number }) + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.emit('backPressure', { workerId: this.info.id! }) this.onBackPressureStarted = false } return tasksQueueSize @@ -91,7 +92,8 @@ export class WorkerNode const tasksQueueSize = this.tasksQueue.unshift(task) if (this.hasBackPressure() && !this.onBackPressureStarted) { this.onBackPressureStarted = true - this.emit('backPressure', { workerId: this.info.id as number }) + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.emit('backPressure', { workerId: this.info.id! }) this.onBackPressureStarted = false } return tasksQueueSize @@ -212,7 +214,8 @@ export class WorkerNode private initWorkerInfo (worker: Worker): WorkerInfo { return { id: getWorkerId(worker), - type: getWorkerType(worker) as WorkerType, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + type: getWorkerType(worker)!, dynamic: false, ready: false, stealing: false @@ -263,7 +266,8 @@ export class WorkerNode for (const task of this.tasksQueue) { if ( (task.name === DEFAULT_TASK_NAME && - name === (this.info.taskFunctionNames as string[])[1]) || + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + name === this.info.taskFunctionNames![1]) || (task.name !== DEFAULT_TASK_NAME && name === task.name) ) { ++taskFunctionQueueSize