mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
ff8320bce0
use it.
9 lines
No EOL
329 B
CoffeeScript
9 lines
No EOL
329 B
CoffeeScript
redback = require("redback").createClient()
|
|
|
|
module.exports =
|
|
|
|
addCount: (opts, callback = (opts, shouldProcess)->)->
|
|
ratelimit = redback.createRateLimit(opts.endpointName)
|
|
ratelimit.addCount opts.subjectName, opts.timeInterval, (err, callCount)->
|
|
shouldProcess = callCount < opts.throttle
|
|
callback(err, shouldProcess) |