X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fabstract-worker.ts;h=ec77ccab8d68c7990339b9331cf6fd4903a7d1fe;hb=f22545899538e05c24ec929bbc16444b7bc23cb0;hp=7803ce2eb836b003159760ce408f97fb3acedd50;hpb=6e5d7052fe741b50e68f8614b33d3754be41415f;p=poolifier.git diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 7803ce2e..ec77ccab 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -399,7 +399,7 @@ export abstract class AbstractWorker< protected handleKillMessage (message: MessageValue): void { this.stopCheckActive() if (isAsyncFunction(this.opts.killHandler)) { - ;(this.opts.killHandler() as Promise) + ;(this.opts.killHandler as () => Promise)() .then(() => { this.sendToMainWorker({ kill: 'success' }) return undefined @@ -555,7 +555,7 @@ export abstract class AbstractWorker< workerError: { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion name: name!, - message: this.handleError(error), + message: this.handleError(error as Error | string), data, }, taskId,