mod_http_oauth2: Clean cache less frequently
authorKim Alvefur <zash@zash.se>
Mon, 24 Jul 2023 01:26:41 +0200
changeset 5622 869c01d91aea
parent 5621 d8622797e315
child 5623 81042c2a235a
mod_http_oauth2: Clean cache less frequently Seems unlikely that enough unused and expired codes accumulate to warrant an hourly job.
mod_http_oauth2/mod_http_oauth2.lua
--- a/mod_http_oauth2/mod_http_oauth2.lua	Mon Jul 24 01:30:14 2023 +0200
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Mon Jul 24 01:26:41 2023 +0200
@@ -216,9 +216,8 @@
 	return code_expired(code)
 end);
 
--- Periodically clear out unredeemed codes.  Does not need to be exact, expired
--- codes are rejected if tried. Mostly just to keep memory usage in check.
-module:hourly("Clear expired authorization codes", function()
+-- Clear out unredeemed codes so they don't linger in memory.
+module:daily("Clear expired authorization codes", function()
 	local k, code = codes:tail();
 	while code and code_expired(code) do
 		codes:set(k, nil);