From aba512c1a7623a0f909219fbe55740f56d992227 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Sun, 9 Jul 2017 13:39:03 +0200 Subject: [PATCH] [Minor] Ratelimit: Custom limits: Pass task to get_limit --- src/plugins/lua/ratelimit.lua | 4 ++-- 1 file 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 -- 2.39.5