From 273615edc123344caf602b3be9fcf93651ab1fe2 Mon Sep 17 00:00:00 2001 From: Gajus Kuizinas Date: Thu, 10 Dec 2020 10:42:26 +0200 Subject: [PATCH] feat: throw an error if limit is less than 0 --- src/factories/createPlanton.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/factories/createPlanton.ts b/src/factories/createPlanton.ts index bad289f..8353841 100644 --- a/src/factories/createPlanton.ts +++ b/src/factories/createPlanton.ts @@ -162,8 +162,8 @@ const createPlanton = (configuration: PlantonConfiguration): Planton => { const limit = concurrency - activeTaskInstructions.length; - if (limit < 1) { - throw new UnexpectedStateError('Limit cannot be less than 1.'); + if (limit < 0) { + throw new UnexpectedStateError('Limit cannot be less than 0.'); } try {