refactor: remove unneeded condition at task response handling
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 14 Aug 2024 12:50:46 +0000 (14:50 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 14 Aug 2024 12:50:46 +0000 (14:50 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index 61f01a6ec684dcd9199b72fc8d900fd473f6ef4f..8f7a6e4765d8145f4eca8d18e996bdaa291ac196 100644 (file)
@@ -2149,12 +2149,7 @@ export abstract class AbstractPool<
       // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       this.promiseResponseMap.delete(taskId!)
       workerNode.emit('taskFinished', taskId)
-      if (
-        this.opts.enableTasksQueue === true &&
-        !this.destroying &&
-        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
-        workerNode != null
-      ) {
+      if (this.opts.enableTasksQueue === true && !this.destroying) {
         const workerNodeTasksUsage = workerNode.usage.tasks
         if (
           this.tasksQueueSize(workerNodeKey) > 0 &&