From: Jérôme Benoit Date: Sun, 16 Jul 2023 17:42:14 +0000 (+0200) Subject: refactor: cleanup worker.addTaskFunction() X-Git-Tag: v2.6.18~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=646d040a3beab622286af393459777f74b1366ba;p=poolifier.git refactor: cleanup worker.addTaskFunction() Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 8a6b2104..7d5494de 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -198,8 +198,8 @@ export abstract class AbstractWorker< if (typeof fn !== 'function') { throw new TypeError('fn parameter is not a function') } - const boundFn = fn.bind(this) try { + const boundFn = fn.bind(this) if ( this.taskFunctions.get(name) === this.taskFunctions.get(DEFAULT_TASK_NAME)