From 1d60483e9f9ea04a22df9264d92dad6872255d1d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 24 Dec 2022 21:37:02 +0000 Subject: [PATCH] [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 -- 2.39.5