Software /
code /
prosody
Diff
plugins/mod_mam/mod_mam.lua @ 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 |
parent | 8230:154852646095 |
child | 8250:9ea5ea53744b |
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]?)");