refactor: cleanup handleWorkerNodeBackPressureEvent()
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 14 May 2024 11:41:58 +0000 (13:41 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 14 May 2024 11:41:58 +0000 (13:41 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index e1042885e6d15d4e02c7f65d69c928561978ce18..52bd73becbf5000cef602490de9a742019036cde 100644 (file)
@@ -1899,12 +1899,12 @@ export abstract class AbstractPool<
     ) {
       return
     }
-    const { workerId } = eventDetail
     const sizeOffset = 1
     // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     if (this.opts.tasksQueueOptions!.size! <= sizeOffset) {
       return
     }
+    const { workerId } = eventDetail
     const sourceWorkerNode =
       this.workerNodes[this.getWorkerNodeKeyByWorkerId(workerId)]
     const workerNodes = this.workerNodes