diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-10 15:16:24 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-10 15:16:24 +0100 |
commit | e5e1a434c9d305926ce30bfb1551dc072620d4ef (patch) | |
tree | 823baf172c59bf198ea88105d412f2bfd0d8c04a | |
parent | 0fa1c80b1d4f962ccf8d24f040c700346ed874f0 (diff) | |
download | rspamd-e5e1a434c9d305926ce30bfb1551dc072620d4ef.tar.gz rspamd-e5e1a434c9d305926ce30bfb1551dc072620d4ef.zip |
[Minor] Fix return value
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index 446906dd2..466ebafce 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -64,7 +64,7 @@ local bucket_check_script = [[ redis.call('HSET', KEYS[1], 'dr', '10000') redis.call('HSET', KEYS[1], 'db', '10000') redis.call('EXPIRE', KEYS[1], KEYS[5]) - return 0 + return {0, 0, 1, 1} end last = tonumber(last) @@ -376,8 +376,7 @@ local function ratelimit_cb(task) return function(err, data) if err then rspamd_logger.errx('cannot check limit %s: %s %s', prefix, err, data) - end - if data and data[1] and data[1] == 1 then + elseif type(data) == 'table' and data[1] and data[1] == 1 then if settings.info_symbol then task:insert_result(settings.info_symbol, 1.0, prefix) end |