From 36d643deec635298ec5f67011e1b6698f0dc1a72 Mon Sep 17 00:00:00 2001 From: spacewander Date: Mon, 19 Apr 2021 18:31:00 +0800 Subject: [PATCH] fix: add code which is removed in #3991 by mistake. Close #3988 Signed-off-by: spacewander --- apisix/plugins/limit-count/limit-count-redis.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apisix/plugins/limit-count/limit-count-redis.lua b/apisix/plugins/limit-count/limit-count-redis.lua index 7958bdc840d9..253d557595c0 100644 --- a/apisix/plugins/limit-count/limit-count-redis.lua +++ b/apisix/plugins/limit-count/limit-count-redis.lua @@ -93,6 +93,11 @@ function _M.incoming(self, key) return nil, err end + local ok, err = red:set_keepalive(10000, 100) + if not ok then + return nil, err + end + if remaining < 0 then return nil, "rejected" end