# HG changeset patch # User Kim Alvefur # Date 1690154801 -7200 # Node ID 869c01d91aea570f124d0309b4ea76336e276e1a # Parent d8622797e315007a758a70a6bc941556bcf6e28c mod_http_oauth2: Clean cache less frequently Seems unlikely that enough unused and expired codes accumulate to warrant an hourly job. diff -r d8622797e315 -r 869c01d91aea 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);