- /** {@inheritDoc} */
- public remove (workerKey: number): boolean {
- if (this.currentWorkerId === workerKey) {
- this.currentWorkerId =
- this.currentWorkerId > this.pool.workers.length - 1
- ? this.pool.workers.length - 1
- : this.currentWorkerId
+ /** @inheritDoc */
+ public remove (workerNodeKey: number): boolean {
+ if (this.currentWorkerNodeId === workerNodeKey) {
+ if (this.pool.workerNodes.length === 0) {
+ this.currentWorkerNodeId = 0
+ } else {
+ this.currentWorkerNodeId =
+ this.currentWorkerNodeId > this.pool.workerNodes.length - 1
+ ? this.pool.workerNodes.length - 1
+ : this.currentWorkerNodeId
+ }