From: Jérôme Benoit Date: Wed, 8 May 2024 21:36:23 +0000 (+0200) Subject: fix: guard worker node back pressure flag change X-Git-Tag: v4.0.4~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=37d821df9ba9212fec91de9992f37aea93b661b1;p=poolifier.git fix: guard worker node back pressure flag change Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index 88c6e8d1..c1c1e0a9 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -90,8 +90,8 @@ export class WorkerNode this.setBackPressureFlag = true this.info.backPressure = true this.emit('backPressure', { workerId: this.info.id }) + this.setBackPressureFlag = false } - this.setBackPressureFlag = false return tasksQueueSize } @@ -105,8 +105,8 @@ export class WorkerNode ) { this.setBackPressureFlag = true this.info.backPressure = false + this.setBackPressureFlag = false } - this.setBackPressureFlag = false return task }