Skip to content

Commit

Permalink
Set currentUsage to actual usage instead of remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinLeeGordon committed Jan 14, 2019
1 parent 76e937e commit c736bb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ class Client extends EventEmitter {
if (this.usageLimit === undefined) {
this.usageLimit = headers['x-hubspot-ratelimit-daily']
}
this.currentUsage = headers['x-hubspot-ratelimit-daily-remaining']
if (this.usageLimit !== undefined) {
this.currentUsage =
this.usageLimit - headers['x-hubspot-ratelimit-daily-remaining']
}
return Promise.resolve()
}

Expand Down

0 comments on commit c736bb0

Please sign in to comment.