mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 13:21:37 +02:00
Fix small mistakes
This commit is contained in:
@@ -8,14 +8,13 @@ module.exports = RateLimiter =
|
||||
_buildKey: (endpoint, subject) ->
|
||||
return "RateLimiter:#{endpoint}:{#{subject}}"
|
||||
|
||||
addCount: (opts, callback = (opts, shouldProcess)->)->
|
||||
addCount: (opts, callback = (err, shouldProcess)->)->
|
||||
k = RateLimiter._buildKey(opts.endpointName, opts.subjectName)
|
||||
multi = rclient.multi()
|
||||
multi.incr(k)
|
||||
multi.get(k)
|
||||
multi.expire(k, opts.timeInterval)
|
||||
multi.exec (err, results)->
|
||||
console.log ">> results", results
|
||||
count = results[1]
|
||||
# account for the different results from `multi` when using cluster
|
||||
if count instanceof Object
|
||||
|
||||
Reference in New Issue
Block a user