Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Dec 19, 2023
1 parent 170eaea commit a2c18f8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions kong/globalpatches.lua
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,10 @@ return function(options)
if expire_at == nil then
return 0
end
local remaining = expire_at - ngx.now()
if remaining == 0 then
return nil, "not found"
end
return remaining
-- There is a problem that also exists in the official OpenResty:
-- 0 means the key never expires. So it's hard to distinguish between a
-- never-expired key and an expired key with a TTL value of 0.
return expire_at - ngx.now()
end

-- hack
Expand Down

0 comments on commit a2c18f8

Please sign in to comment.