X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fabstract-pool.ts;h=d65ac2ffe7a92775e428e1a28ba8867a681ec136;hb=3d84cdaec91dfe96a82462c902bead4067b452d2;hp=10c99171dcf06349063fd59772fe4a889c11d346;hpb=8bd0556f30713198367ca520d242b662f5fe147a;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 10c99171..d65ac2ff 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1671,23 +1671,23 @@ export abstract class AbstractPool< if (workerNode?.usage != null) { ++workerNode.usage.tasks.sequentiallyStolen } - const taskFunctionWorkerUsage = - workerNode.getTaskFunctionWorkerUsage(taskName) if ( this.shallUpdateTaskFunctionWorkerUsage(workerNodeKey) && - taskFunctionWorkerUsage != null && - (taskFunctionWorkerUsage.tasks.sequentiallyStolen === 0 || + workerNode.getTaskFunctionWorkerUsage(taskName) != null + ) { + const taskFunctionWorkerUsage = + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + workerNode.getTaskFunctionWorkerUsage(taskName)! + if ( + taskFunctionWorkerUsage.tasks.sequentiallyStolen === 0 || (previousTaskName != null && previousTaskName === taskName && - taskFunctionWorkerUsage.tasks.sequentiallyStolen > 0)) - ) { - ++taskFunctionWorkerUsage.tasks.sequentiallyStolen - } else if ( - this.shallUpdateTaskFunctionWorkerUsage(workerNodeKey) && - taskFunctionWorkerUsage != null && - taskFunctionWorkerUsage.tasks.sequentiallyStolen > 0 - ) { - taskFunctionWorkerUsage.tasks.sequentiallyStolen = 0 + taskFunctionWorkerUsage.tasks.sequentiallyStolen > 0) + ) { + ++taskFunctionWorkerUsage.tasks.sequentiallyStolen + } else if (taskFunctionWorkerUsage.tasks.sequentiallyStolen > 0) { + taskFunctionWorkerUsage.tasks.sequentiallyStolen = 0 + } } }