From 640610c759a1d562101fd0e91936cb9959476910 Mon Sep 17 00:00:00 2001 From: ilsemaj Date: Wed, 7 Oct 2020 14:47:16 -0700 Subject: [PATCH] Bugfix #23: Update on limiter constants (#25) * Adding reservoir limitations * Changing limiter constants per bug #23 * Update package.json & node-fetch version Co-authored-by: James Li --- lib/Methods.js | 1 + lib/constants.js | 3 ++- package-lock.json | 10 +++++----- package.json | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Methods.js b/lib/Methods.js index a93f0f8..ebac37b 100644 --- a/lib/Methods.js +++ b/lib/Methods.js @@ -11,6 +11,7 @@ const { // Create new rate limiter using defined constants const limiter = new Bottleneck({ + reservoir: constants.LIMITER_RESERVOIR, reservoirRefreshInterval: constants.LIMITER_REFRESH_INTERVAL, maxConcurrent: constants.LIMITER_MAX_CONCURRENT, minTime: constants.LIMITER_MIN_TIME, diff --git a/lib/constants.js b/lib/constants.js index 7807c29..48d4b60 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -1,6 +1,7 @@ const constants = { + LIMITER_RESERVOIR: 20, LIMITER_REFRESH_INTERVAL: 250, - LIMITER_MAX_CONCURRENT: 5, + LIMITER_MAX_CONCURRENT: 1, LIMITER_MIN_TIME: 50, }; diff --git a/package-lock.json b/package-lock.json index b698584..c2bc9e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@onfleet/node-onfleet", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -441,7 +441,7 @@ "js-yaml": "^3.13.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.11", + "lodash": ">=4.17.19", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", @@ -1352,9 +1352,9 @@ } }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, "normalize-package-data": { "version": "2.5.0", diff --git a/package.json b/package.json index e6aeda2..f1bcc21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onfleet/node-onfleet", - "version": "1.1.0", + "version": "1.1.1", "description": "Official client library for accessing the Onfleet API", "main": "index.js", "scripts": { @@ -21,7 +21,7 @@ "homepage": "https://onfleet.com/", "dependencies": { "bottleneck": "^2.19.5", - "node-fetch": "^2.6.0" + "node-fetch": "^2.6.1" }, "devDependencies": { "chai": "^4.2.0",