perf: optimize condition checks order
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 10 Sep 2023 16:53:11 +0000 (18:53 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 10 Sep 2023 16:53:11 +0000 (18:53 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index 3dcbceaba1bfb6012f98c80c73f81a332f80e468..6457b1554ddbf5bfeb0156a0d40e9bb108dd02dc 100644 (file)
@@ -1071,8 +1071,8 @@ export abstract class AbstractPool<
       this.emitter?.emit(PoolEvents.error, error)
       if (
         this.opts.restartWorkerOnError === true &&
-        !this.starting &&
-        this.started
+        this.started &&
+        !this.starting
       ) {
         if (workerInfo.dynamic) {
           this.createAndSetupDynamicWorkerNode()