fix: get wait time statistics
[poolifier.git] / src / worker / abstract-worker.ts
index a84bb0691fc588d3a8e51b0fe1696d7c85bb7dc9..b0da7b3e8526d2271bc18204c8b4ba6fc961ed21 100644 (file)
@@ -160,13 +160,13 @@ export abstract class AbstractWorker<
     } else if (message.parent != null) {
       // Main worker reference message received
       this.mainWorker = message.parent
+    } else if (message.statistics != null) {
+      // Statistics message received
+      this.statistics = message.statistics
     } else if (message.kill != null) {
       // Kill message received
       this.aliveInterval != null && clearInterval(this.aliveInterval)
       this.emitDestroy()
-    } else if (message.statistics != null) {
-      // Statistics message received
-      this.statistics = message.statistics
     }
   }