Software /
code /
prosody-modules
Comparison
mod_mam/mod_mam.lua @ 2049:50c188cf0ae3
mod_mam: Include 'w' (week) in pattern for "archive_expires_after" option (fixes #627)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 15 Feb 2016 23:56:12 +0100 |
parent | 2042:752eee154891 |
child | 2270:9c99200afd17 |
comparison
equal
deleted
inserted
replaced
2048:2c6bc38f19a6 | 2049:50c188cf0ae3 |
---|---|
274 local cleanup_after = module:get_option_string("archive_expires_after", "1w"); | 274 local cleanup_after = module:get_option_string("archive_expires_after", "1w"); |
275 local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60); | 275 local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60); |
276 if cleanup_after ~= "never" then | 276 if cleanup_after ~= "never" then |
277 local day = 86400; | 277 local day = 86400; |
278 local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day }; | 278 local multipliers = { d = day, w = day * 7, m = 31 * day, y = 365.2425 * day }; |
279 local n, m = cleanup_after:lower():match("(%d+)%s*([dmy]?)"); | 279 local n, m = cleanup_after:lower():match("(%d+)%s*([dwmy]?)"); |
280 if not n then | 280 if not n then |
281 module:log("error", "Could not parse archive_expires_after string %q", cleanup_after); | 281 module:log("error", "Could not parse archive_expires_after string %q", cleanup_after); |
282 return false; | 282 return false; |
283 end | 283 end |
284 | 284 |