Changeset

2022:77b9c7e5fd63

mod_mam: Allow interval between archive cleanup to be changed
author Kim Alvefur <zash@zash.se>
date Tue, 19 Jan 2016 17:47:05 +0100
parents 2021:5fb917b86838
children 2023:98b4794b72e4
files mod_mam/README.markdown mod_mam/mod_mam.lua
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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
 ---------------
--- 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