Skip to content

Commit

Permalink
bugfix: fix limit-count plugin redis.ttl error. (#1928)
Browse files Browse the repository at this point in the history
FIX #1901
  • Loading branch information
shuaijinchao authored Jul 30, 2020
1 parent c6f7af6 commit 2433152
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apisix/plugins/limit-count/limit-count-redis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ function _M.incoming(self, key)
local remaining
key = self.plugin_name .. tostring(key)

local ret = red:ttl(key)
-- todo: test case
local ret, err = red:ttl(key)
if not ret then
return false, "failed to get redis `" .. key .."` ttl: " .. err
end

core.log.info("ttl key: ", key, " ret: ", ret, " err: ", err)
if ret < 0 then
-- todo: test case
Expand Down

0 comments on commit 2433152

Please sign in to comment.