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:/
135135``` js
136136const Redis = require (' ioredis' )
137137const redis = new Redis (uri, {
138- scripts: { ratelimiter : require (' async-ratelimiter' ).defineCommand }
138+ scripts: { ... require (' async-ratelimiter' ).defineCommand }
139139})
140140```
141141
Original file line number Diff line number Diff line change 33const assert = require ( 'assert' )
44const microtime = require ( './microtime' )
55
6- const defineCommand = {
6+ const ratelimiter = {
77 numberOfKeys : 1 ,
88 lua : `
99 local key = KEYS[1]
@@ -83,7 +83,7 @@ module.exports = class Limiter {
8383 this . duration = duration
8484 this . namespace = namespace
8585 if ( ! this . db . ratelimiter ) {
86- this . db . defineCommand ( 'ratelimiter' , defineCommand )
86+ this . db . defineCommand ( 'ratelimiter' , ratelimiter )
8787 }
8888 }
8989
@@ -107,4 +107,4 @@ module.exports = class Limiter {
107107 }
108108}
109109
110- module . exports . defineCommand = defineCommand
110+ module . exports . defineCommand = { ratelimiter }
You can’t perform that action at this time.
0 commit comments