aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_mam
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-21 18:16:03 +0100
committerKim Alvefur <zash@zash.se>2021-11-21 18:16:03 +0100
commitbba9ed5aff180e75ac2fc0618a30b4b5c7e0ef94 (patch)
tree16b99cbb24d2b687f4ec9586107743e143943ae3 /plugins/mod_mam
parent7f2412db5c6ce5e85347ba558a79cc1ff8462605 (diff)
downloadprosody-bba9ed5aff180e75ac2fc0618a30b4b5c7e0ef94.tar.gz
prosody-bba9ed5aff180e75ac2fc0618a30b4b5c7e0ef94.zip
mod_mam: Switch to new cron API
Diffstat (limited to 'plugins/mod_mam')
-rw-r--r--plugins/mod_mam/mod_mam.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua
index e418d60d..afbd6500 100644
--- a/plugins/mod_mam/mod_mam.lua
+++ b/plugins/mod_mam/mod_mam.lua
@@ -43,7 +43,6 @@ local archive_store = module:get_option_string("archive_store", "archive");
local archive = module:open_store(archive_store, "archive");
local cleanup_after = module:get_option_string("archive_expires_after", "1w");
-local cleanup_interval = module:get_option_number("archive_cleanup_interval", 4 * 60 * 60);
local archive_item_limit = module:get_option_number("storage_archive_item_limit", archive.caps and archive.caps.quota or 1000);
local archive_truncate = math.floor(archive_item_limit * 0.99);
@@ -524,7 +523,7 @@ if cleanup_after ~= "never" then
local cleanup_time = module:measure("cleanup", "times");
local async = require "util.async";
- cleanup_runner = async.runner(function ()
+ module:daily("Remove expired messages", function ()
local cleanup_done = cleanup_time();
if archive.caps and archive.caps.wildcard_delete then
@@ -580,10 +579,6 @@ if cleanup_after ~= "never" then
cleanup_done();
end);
- cleanup_task = module:add_timer(1, function ()
- cleanup_runner:run(true);
- return cleanup_interval;
- end);
else
module:log("debug", "Archive expiry disabled");
-- Don't ask the backend to count the potentially unbounded number of items,