# HG changeset patch # User Kim Alvefur # Date 1513821891 -3600 # Node ID d070a751b6eddf20fb8a80a2331b646efc046ce2 # Parent cb7c24305ed2b2cf8d97f4fa7032a3b196c60ed6 mod_s2s_auth_posh: Cache tweak diff -r cb7c24305ed2 -r d070a751b6ed mod_s2s_auth_posh/mod_s2s_auth_posh.lua --- a/mod_s2s_auth_posh/mod_s2s_auth_posh.lua Wed Mar 15 15:49:46 2017 +0100 +++ b/mod_s2s_auth_posh/mod_s2s_auth_posh.lua Thu Dec 21 03:04:51 2017 +0100 @@ -33,9 +33,13 @@ end local cached = cache:get(target_host); - if cached and os.time() < cached.expires then - host_session.posh = { jwk = cached }; - return false; + if cached then + if os.time() > cached.expires then + cache:set(target_host, nil); + else + host_session.posh = { jwk = cached }; + return false; + end end local log = host_session.log or module._log;