Changeset

8231:97a094fdf101

mod_mam: Log a message in case archive deletion is not supported by the storage module in use
author Kim Alvefur <zash@zash.se>
date Tue, 12 Sep 2017 14:59:52 +0200
parents 8230:154852646095
children 8234:97b3ca502547
files plugins/mod_mam/mod_mam.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_mam/mod_mam.lua	Tue Sep 12 14:42:56 2017 +0200
+++ b/plugins/mod_mam/mod_mam.lua	Tue Sep 12 14:59:52 2017 +0200
@@ -333,7 +333,9 @@
 
 local cleanup_after = module:get_option_string("archive_expires_after", "1w");
 local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60);
-if cleanup_after ~= "never" then
+if not archive.delete then
+	module:log("debug", "Selected storage driver does not support deletion, archives will not expire");
+elseif cleanup_after ~= "never" then
 	local day = 86400;
 	local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day };
 	local n, m = cleanup_after:lower():match("(%d+)%s*([dwmy]?)");