We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9205a0a commit 0b0690fCopy full SHA for 0b0690f
index.js
@@ -68,7 +68,7 @@ Limiter.prototype.get = function (fn) {
68
function create() {
69
var ex = (Date.now() + duration) / 1000 | 0;
70
71
- db.multi()
+ db.multi()
72
.set([count, max, 'PX', duration, 'NX'])
73
.set([limit, max, 'PX', duration, 'NX'])
74
.set([reset, ex, 'PX', duration, 'NX'])
@@ -116,15 +116,15 @@ Limiter.prototype.get = function (fn) {
116
}
117
118
function mget() {
119
- db.watch([count], function (err) {
120
- if (err) return fn(err);
121
- db.mget([count, limit, reset], function (err, res) {
122
123
- if (!res[0] && res[0] !== 0) return create();
124
-
125
- decr(res);
126
- });
127
+ db.watch([count], function (err) {
+ if (err) return fn(err);
+ db.mget([count, limit, reset], function (err, res) {
+ if (!res[0] && res[0] !== 0) return create();
+
+ decr(res);
+ });
128
129
130
mget();
0 commit comments