Skip to content

Commit

Permalink
[Mongodb] X-RateLimit-Remaining and X-RateLimit-Reset headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanclaudeyalap committed Jun 8, 2019
1 parent 1f545b4 commit 5082dd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/MongodbStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ class MongodbStore extends Store {
defaults: {
key,
dateEnd: Date.now() + options.interval,
counter: 0,
},
});
await this._increment(this.Ratelimits, { key }, weight, 'counter');
return {
counter: data.counter + weight,
dateEnd: data.dateEnd,
counter: data.value.counter + weight,
dateEnd: data.value.dateEnd,
};
}

Expand Down

0 comments on commit 5082dd9

Please sign in to comment.