chore: add changelog entry
[poolifier.git] / src / pools / abstract-pool.ts
index 3cb6c1f7a7b034086e6e20a56635c44f1d8af0f2..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
@@ -208,7 +208,8 @@ export abstract class AbstractPool<
     const res = this.internalExecute(worker, this.nextMessageId)
     this.checkAndEmitBusy()
     this.sendToWorker(worker, {
-      data,
+      // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
+      data: data ?? ({} as Data),
       id: this.nextMessageId
     })
     ++this.nextMessageId