From b137ab82c1c411bf02871e4e4a010b8dfa4c76f8 Mon Sep 17 00:00:00 2001 From: Mitra Ardron Date: Wed, 26 Jun 2019 20:41:28 +1000 Subject: [PATCH] Tweak http queue --- httptools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httptools.js b/httptools.js index 7bc956d..752af65 100644 --- a/httptools.js +++ b/httptools.js @@ -30,7 +30,7 @@ function queueSetup({concurrency}) { fetch(task.req) .then(res => { debug("Fetch of %s succeded", task.what); - httpTaskQueue.concurrency++; + httpTaskQueue.concurrency = Math.min(httpTaskQueue.concurrency+1, httpTaskQueue.running()+6); debug("Raising concurrency to %s", httpTaskQueue.concurrency); cb(null); task.cb(null, res);