Skip to content

Commit

Permalink
fix(acme) set cache to non zero ttl in dbless
Browse files Browse the repository at this point in the history
Fix #53
  • Loading branch information
fffonion committed Oct 13, 2020
1 parent 2fb8606 commit 571642f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kong/plugins/acme/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ local function cached_get(storage, key, deserializer, ttl, neg_ttl)
local cache_key = kong.db.acme_storage:cache_key(key)
return kong.cache:get(cache_key, {
l1_serializer = deserializer,
ttl = ttl,
-- in dbless mode, kong.cache has mlcache set to 0 as ttl
-- we override the default setting here so that cert can be invalidated
-- with renewal.
ttl = math.max(ttl or 3600, 0),
neg_ttl = neg_ttl,
}, storage.get, storage, key)
end
Expand Down

0 comments on commit 571642f

Please sign in to comment.