File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ It provides the command definition so you can load it into any [ioredis](https:/
135
135
``` js
136
136
const Redis = require (' ioredis' )
137
137
const redis = new Redis (uri, {
138
- scripts: { ratelimiter : require (' async-ratelimiter' ).defineCommand }
138
+ scripts: { ... require (' async-ratelimiter' ).defineCommand }
139
139
})
140
140
```
141
141
Original file line number Diff line number Diff line change 3
3
const assert = require ( 'assert' )
4
4
const microtime = require ( './microtime' )
5
5
6
- const defineCommand = {
6
+ const ratelimiter = {
7
7
numberOfKeys : 1 ,
8
8
lua : `
9
9
local key = KEYS[1]
@@ -83,7 +83,7 @@ module.exports = class Limiter {
83
83
this . duration = duration
84
84
this . namespace = namespace
85
85
if ( ! this . db . ratelimiter ) {
86
- this . db . defineCommand ( 'ratelimiter' , defineCommand )
86
+ this . db . defineCommand ( 'ratelimiter' , ratelimiter )
87
87
}
88
88
}
89
89
@@ -107,4 +107,4 @@ module.exports = class Limiter {
107
107
}
108
108
}
109
109
110
- module . exports . defineCommand = defineCommand
110
+ module . exports . defineCommand = { ratelimiter }
You can’t perform that action at this time.
0 commit comments