# HG changeset patch # User Kim Alvefur # Date 1453222025 -3600 # Node ID 77b9c7e5fd635786c6277305d435b372d6e44043 # Parent 5fb917b868381b96e4beb9fae5347f14dcafb499 mod_mam: Allow interval between archive cleanup to be changed diff -r 5fb917b86838 -r 77b9c7e5fd63 mod_mam/README.markdown --- a/mod_mam/README.markdown Tue Jan 19 14:34:12 2016 +0100 +++ b/mod_mam/README.markdown Tue Jan 19 17:47:05 2016 +0100 @@ -37,10 +37,12 @@ -------------- option type default - ------------------------------ ----------------------- --------- + ------------------------------ ----------------------- ----------- max\_archive\_query\_results number `50` default\_archive\_policy boolean or `"roster"` `true` archive\_expires\_after string `"1w"` + archive\_cleanup\_interval number `4*60*60` + Storage backend --------------- diff -r 5fb917b86838 -r 77b9c7e5fd63 mod_mam/mod_mam.lua --- a/mod_mam/mod_mam.lua Tue Jan 19 14:34:12 2016 +0100 +++ b/mod_mam/mod_mam.lua Tue Jan 19 17:47:05 2016 +0100 @@ -272,7 +272,7 @@ end local cleanup_after = module:get_option_string("archive_expires_after", "1w"); -local cleanup_interval = module:get_option_number("archive_expire_interval", 4 * 60 * 60); +local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60); if cleanup_after ~= "never" then local day = 86400; local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day }; @@ -308,7 +308,7 @@ end user[cleanup] = nil; end - return 14400; + return cleanup_interval; end); end