diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-26 17:22:22 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-02-26 17:22:22 +0000 |
commit | 40859574da2836f957efc983d5818f52c3b46dad (patch) | |
tree | a84de79406ae8b10412f7de03cb54de4f72d5618 /src | |
parent | dcc9f98944e475ebf5a31b0a6a96ac1004010abe (diff) | |
download | rspamd-40859574da2836f957efc983d5818f52c3b46dad.tar.gz rspamd-40859574da2836f957efc983d5818f52c3b46dad.zip |
Fix closure parameters.
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index c816e12ca..99f5d83b8 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -141,6 +141,10 @@ end --- Set specific limit inside redis local function set_limits(task, args) + local key = _.foldl(function(acc, k) return acc .. k[2] end, '', args) + local upstream = upstreams:get_upstream_by_hash(key) + local addr = upstream:get_addr() + local function rate_set_key_cb(task, err, data) if err then rspamd_logger.info('got error while setting limit: ' .. err) @@ -149,9 +153,6 @@ local function set_limits(task, args) upstream:ok() end end - local key = _.foldl(function(acc, k) return acc .. k[2] end, '', args) - local upstream = upstreams:get_upstream_by_hash(key) - local addr = upstream:get_addr() local function rate_set_cb(task, err, data) if data then |