Skip to content

Commit

Permalink
Bugfix #23: Update on limiter constants (#25)
Browse files Browse the repository at this point in the history
* Adding reservoir limitations

* Changing limiter constants per bug #23

* Update package.json & node-fetch version

Co-authored-by: James Li <[email protected]>
  • Loading branch information
jamesliupenn and James Li authored Oct 7, 2020
1 parent 1acaf7c commit 640610c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/Methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion lib/constants.js
Original file line number Diff line number Diff line change
@@ -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,
};

Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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",
Expand Down

0 comments on commit 640610c

Please sign in to comment.