diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-07-09 13:39:03 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-07-09 13:39:03 +0200 |
commit | 3fe7f24e43a5edab3cb48e72a107ddff4c8d1780 (patch) | |
tree | 75549eddecc4b82585a56aec97dbda1fd0583a56 | |
parent | b29b6ee49c9b3f16cf5adf5cc49065aac2f72282 (diff) | |
download | rspamd-3fe7f24e43a5edab3cb48e72a107ddff4c8d1780.tar.gz rspamd-3fe7f24e43a5edab3cb48e72a107ddff4c8d1780.zip |
[Minor] Ratelimit: Custom limits: Pass task to get_limit
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index beb9eb283..2c42c2876 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -509,7 +509,7 @@ local function rate_test_set(task, func) table.insert(args, {settings[k], rk}) elseif type(settings[k]) == 'string' and (custom_keywords[settings[k]] and type(custom_keywords[settings[k]]['get_limit']) == 'function') then - local res = custom_keywords[settings[k]]['get_limit']() + local res = custom_keywords[settings[k]]['get_limit'](task) if type(res) == 'table' then table.insert(args, {res, rate_key}) elseif type(res) == 'string' then @@ -525,7 +525,7 @@ local function rate_test_set(task, func) table.insert(args, {settings[k], rate_key}) elseif type(settings[k]) == 'string' and (custom_keywords[settings[k]] and type(custom_keywords[settings[k]]['get_limit']) == 'function') then - local res = custom_keywords[settings[k]]['get_limit']() + local res = custom_keywords[settings[k]]['get_limit'](task) if type(res) == 'table' then table.insert(args, {res, rate_key}) elseif type(res) == 'string' then |