commit 1d60483: [Fix] Ratelimit: Use unpack for `HMGET` return value
Vsevolod Stakhov
vsevolod at rspamd.com
Sat Dec 24 21:42:03 UTC 2022
Author: Vsevolod Stakhov
Date: 2022-12-24 21:37:02 +0000
URL: https://github.com/rspamd/rspamd/commit/1d60483e9f9ea04a22df9264d92dad6872255d1d (HEAD -> master)
[Fix] Ratelimit: Use unpack for `HMGET` return value
---
src/plugins/lua/ratelimit.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua
index 7e0afb8fa..9975f17a3 100644
--- a/src/plugins/lua/ratelimit.lua
+++ b/src/plugins/lua/ratelimit.lua
@@ -81,7 +81,7 @@ local bucket_check_script = [[
end
last = tonumber(last)
- local burst,pending = redis.call('HMGET', KEYS[1], 'b', 'p')
+ local burst,pending = unpack(redis.call('HMGET', KEYS[1], 'b', 'p'))
burst,pending = tonumber(burst or '0'),tonumber(pending or '0')
-- Sanity to avoid races
if burst < 0 then burst = 0 end
More information about the Commits
mailing list