X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=src%2Fpools%2Futils.ts;h=b7b38ac4a874f279f316929a80514f306b60390a;hb=59ca7cfff23a8ad84efaf61ab8c1015e67e97c24;hp=b33726a69f3f72113061d8fb918983ef75cbfa59;hpb=5d9133ae9ef83c5f69e26daf8dcfea584884d9c4;p=poolifier.git diff --git a/src/pools/utils.ts b/src/pools/utils.ts index b33726a6..b7b38ac4 100644 --- a/src/pools/utils.ts +++ b/src/pools/utils.ts @@ -187,6 +187,21 @@ export const checkWorkerNodeArguments = ( 'Cannot construct a worker node with a tasks queue back pressure size option that is not a positive integer' ) } + if (opts.tasksQueueBucketSize == null) { + throw new TypeError( + 'Cannot construct a worker node without a tasks queue bucket size option' + ) + } + if (!Number.isSafeInteger(opts.tasksQueueBucketSize)) { + throw new TypeError( + 'Cannot construct a worker node with a tasks queue bucket size option that is not an integer' + ) + } + if (opts.tasksQueueBucketSize <= 0) { + throw new RangeError( + 'Cannot construct a worker node with a tasks queue bucket size option that is not a positive integer' + ) + } } /**