Skip to content

Commit 6361f2d

Browse files
committed
Merge branch 'release/2.1.3'
2 parents 2fd1092 + 0c918c4 commit 6361f2d

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ language: node_js
22
node_js:
33
- "0.10"
44
- "0.12"
5-
- "4.2"
5+
- "4"
6+
- "5"
67
services:
7-
- redis-server
8+
- redis-server
89
install:
910
- npm install
1011
script:
1112
- make test
13+

Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
[![Build Status](https://travis-ci.org/tj/node-ratelimiter.svg)](https://travis-ci.org/tj/node-ratelimiter)
66

77
## Release Notes
8+
[v2.1.3](https://github.com/tj/node-ratelimiter/tree/v2.1.3) - [#22](/../../pull/22) by [@coderhaoxin](https://github.com/coderhaoxin) - Dev dependencies versions bump
9+
810
[v2.1.2](https://github.com/tj/node-ratelimiter/tree/v2.1.2) - [#17](/../../pull/17) by [@waleedsamy](https://github.com/waleedsamy) - Add Travis CI support
911

1012
[v2.1.1](https://github.com/tj/node-ratelimiter/tree/v2.1.1) - [#13](/../../pull/13) by [@kwizzn](https://github.com/kwizzn) - Fixes out-of-sync TTLs after running decr()

index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Limiter.prototype.get = function (fn) {
6868
function create() {
6969
var ex = (Date.now() + duration) / 1000 | 0;
7070

71-
db.multi()
71+
db.multi()
7272
.set([count, max, 'PX', duration, 'NX'])
7373
.set([limit, max, 'PX', duration, 'NX'])
7474
.set([reset, ex, 'PX', duration, 'NX'])
@@ -116,15 +116,15 @@ Limiter.prototype.get = function (fn) {
116116
}
117117

118118
function mget() {
119-
db.watch([count], function (err) {
120-
if (err) return fn(err);
121-
db.mget([count, limit, reset], function (err, res) {
122-
if (err) return fn(err);
123-
if (!res[0] && res[0] !== 0) return create();
124-
125-
decr(res);
126-
});
127-
});
119+
db.watch([count], function (err) {
120+
if (err) return fn(err);
121+
db.mget([count, limit, reset], function (err, res) {
122+
if (err) return fn(err);
123+
if (!res[0] && res[0] !== 0) return create();
124+
125+
decr(res);
126+
});
127+
});
128128
}
129129

130130
mget();

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ratelimiter",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"repository": "visionmedia/node-ratelimiter",
55
"description": "abstract rate limiter backed by redis",
66
"keywords": [
@@ -11,9 +11,9 @@
1111
],
1212
"dependencies": {},
1313
"devDependencies": {
14-
"ioredis": "1.9.0",
14+
"ioredis": "1.15.1",
1515
"mocha": "*",
16-
"redis": "0.10.2",
16+
"redis": "2.6.0-1",
1717
"should": "*"
1818
},
1919
"license": "MIT",

0 commit comments

Comments
 (0)