perf: only check worker status when necessary
[poolifier.git] / src / pools / abstract-pool.ts
index 6531d6615349bda3b7223329977963ee7eba95a5..122e9fa5c9dbbad12f7eaf01b1db4f0b38ab35e4 100644 (file)
@@ -105,7 +105,7 @@ export abstract class AbstractPool<
             this.getWorkerRunningTasks(workerCreated) === 0
           ) {
             // Kill received from the worker, means that no new tasks are submitted to that worker for a while ( > maxInactiveTime)
-            void (this.destroyWorker(workerCreated) as Promise<void>)
+            void this.destroyWorker(workerCreated)
           }
         })
         return workerCreated