Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Add option to ignore API limit check
Browse files Browse the repository at this point in the history
- Added `checkLimit` option to ignore API limit check
  • Loading branch information
AustinLeeGordon committed Jan 11, 2019
1 parent 84265db commit 5c5bb7c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class Client extends EventEmitter {
debug('apiCall', _.pick(params, ['method', 'url']))
this.apiCalls += 1
})
this.checkLimit =
options.checkLimit !== undefined ? options.checkLimit : true

this.broadcasts = new Broadcast(this)
this.campaigns = new Campaign(this)
Expand Down Expand Up @@ -134,6 +136,10 @@ class Client extends EventEmitter {
// don't check the api limit for the api call
return Promise.resolve()
}
if (!this.checkLimit) {
// don't check the api limit for the api call
return Promise.resolve()
}
if (this.maxUsePercent === 0) {
// if maxUsePercent set to 0, do not check for the API limit (use at your own risk)
return Promise.resolve()
Expand Down

0 comments on commit 5c5bb7c

Please sign in to comment.