Mercurial > prosody-hg
comparison 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 |
| parents | 154852646095 |
| children | 9ea5ea53744b |
comparison
equal
deleted
inserted
replaced
| 8230:154852646095 | 8231:97a094fdf101 |
|---|---|
| 331 module:hook("pre-message/bare", strip_stanza_id_after_other_events, -1); | 331 module:hook("pre-message/bare", strip_stanza_id_after_other_events, -1); |
| 332 module:hook("pre-message/full", strip_stanza_id_after_other_events, -1); | 332 module:hook("pre-message/full", strip_stanza_id_after_other_events, -1); |
| 333 | 333 |
| 334 local cleanup_after = module:get_option_string("archive_expires_after", "1w"); | 334 local cleanup_after = module:get_option_string("archive_expires_after", "1w"); |
| 335 local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60); | 335 local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60); |
| 336 if cleanup_after ~= "never" then | 336 if not archive.delete then |
| 337 module:log("debug", "Selected storage driver does not support deletion, archives will not expire"); | |
| 338 elseif cleanup_after ~= "never" then | |
| 337 local day = 86400; | 339 local day = 86400; |
| 338 local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day }; | 340 local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day }; |
| 339 local n, m = cleanup_after:lower():match("(%d+)%s*([dwmy]?)"); | 341 local n, m = cleanup_after:lower():match("(%d+)%s*([dwmy]?)"); |
| 340 if not n then | 342 if not n then |
| 341 module:log("error", "Could not parse archive_expires_after string %q", cleanup_after); | 343 module:log("error", "Could not parse archive_expires_after string %q", cleanup_after); |
