From bcdb750a8367262090cff00e9215d64315e404d2 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 14 Jul 2018 15:03:36 +0100 Subject: [PATCH] [Minor] Fix types --- src/plugins/lua/ratelimit.lua | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 7ab688ebf..839ec5c6c 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -447,7 +447,9 @@ local function ratelimit_cb(task) if ret then local bucket = parse_limit(k, bd) - prefixes[redis_key] = make_prefix(redis_key, k, bucket) + if bucket[1] then + prefixes[redis_key] = make_prefix(redis_key, k, bucket[1]) + end nprefixes = nprefixes + 1 else rspamd_logger.errx(task, 'cannot call handler for %s: %s', @@ -664,14 +666,6 @@ if opts then name = 'RATELIMIT_UPDATE', callback = ratelimit_update_cb, } - - if settings.custom_keywords then - for _, v in pairs(settings.custom_keywords) do - if type(v) == 'table' and type(v['init']) == 'function' then - v['init']() - end - end - end end end -- 2.39.5