Skip to content

Commit

Permalink
Micro optimization in rate limiting
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed May 18, 2018
1 parent d2b80a3 commit ce5860b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/tenso.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class Tenso extends HTTPMethods {
const config = this.config.rate,
id = req.sessionID || req.ip;
let valid = true,
seconds = parseInt(new Date().getTime() / 1000, 10),
seconds = Math.floor(new Date().getTime() / 1000, 10),
limit, remaining, reset, state;

if (this.rates[id] === void 0) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tenso",
"description": "Tensō is an elastic REST API gateway for node.js",
"version": "7.0.3",
"version": "7.0.4",
"homepage": "http://avoidwork.github.io/tenso",
"author": "Jason Mulligan <[email protected]>",
"repository": {
Expand Down

0 comments on commit ce5860b

Please sign in to comment.