Skip to content
Snippets Groups Projects
Commit a7378e7a authored by Martin Schoeler's avatar Martin Schoeler
Browse files

removed the rate limiter for testing

parent 12f38702
No related branches found
No related tags found
No related merge requests found
RocketChat.RateLimiter = new class
limitFunction: (fn, numRequests, timeInterval, matchers) ->
if process.env.TEST_MODE is 'true'
return fn
rateLimiter = new RateLimiter()
rateLimiter.addRule matchers, numRequests, timeInterval
return ->
......@@ -16,6 +18,8 @@ RocketChat.RateLimiter = new class
throw new Meteor.Error 'error-too-many-requests', "Error, too many requests. Please slow down. You must wait #{Math.ceil(rateLimitResult.timeToReset / 1000)} seconds before trying again.", { timeToReset: rateLimitResult.timeToReset, seconds: Math.ceil(rateLimitResult.timeToReset / 1000) }
limitMethod: (methodName, numRequests, timeInterval, matchers) ->
if process.env.TEST_MODE is 'true'
return
match =
type: 'method'
name: methodName
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment