From a11d9870a33cf5550a160f053bc8598a4f46a2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Mart=C3=ADn?= Date: Fri, 2 Mar 2018 13:17:50 +0100 Subject: [PATCH] exporting RATE_LIMIT_REDIS_DB --- app/services/user_limits.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/services/user_limits.js b/app/services/user_limits.js index f93a6d8e..ace53c21 100644 --- a/app/services/user_limits.js +++ b/app/services/user_limits.js @@ -5,7 +5,7 @@ const getRateLimitLuaScript = ` local limits = {} local limitsArray = redis.call("LRANGE", KEYS[1], 0, -1) - + for i, v in ipairs(limitsArray) do local rest = i % 3 if rest ~= 0 then @@ -15,7 +15,7 @@ const getRateLimitLuaScript = ` results[resultsCounter] = redis.call("CL.THROTTLE", KEYS[2], limits[1], limits[2], v) end end - + return results `; @@ -159,3 +159,4 @@ class UserLimits { } module.exports = UserLimits; +module.exports.RATE_LIMIT_REDIS_DB = RATE_LIMIT_REDIS_DB;