diff options
author | Kim Alvefur <zash@zash.se> | 2021-11-22 14:49:05 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-11-22 14:49:05 +0100 |
commit | 16c2ef22e048290e88134877c0104d3263481862 (patch) | |
tree | d73935a01629091602afeaac9aa6cce01b7f4853 /plugins/mod_muc_mam.lua | |
parent | bba9ed5aff180e75ac2fc0618a30b4b5c7e0ef94 (diff) | |
download | prosody-16c2ef22e048290e88134877c0104d3263481862.tar.gz prosody-16c2ef22e048290e88134877c0104d3263481862.zip |
mod_muc_mam: Switch to mod_cron for message expiry
Diffstat (limited to 'plugins/mod_muc_mam.lua')
-rw-r--r-- | plugins/mod_muc_mam.lua | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/plugins/mod_muc_mam.lua b/plugins/mod_muc_mam.lua index 974aa6dc..c2026371 100644 --- a/plugins/mod_muc_mam.lua +++ b/plugins/mod_muc_mam.lua @@ -35,7 +35,6 @@ local timestamp, datestamp = import("util.datetime", "datetime", "date"); local default_max_items, max_max_items = 20, module:get_option_number("max_archive_query_results", 50); local cleanup_after = module:get_option_string("muc_log_expires_after", "1w"); -local cleanup_interval = module:get_option_number("muc_log_cleanup_interval", 4 * 60 * 60); local default_history_length = 20; local max_history_length = module:get_option_number("max_history_messages", math.huge); @@ -494,7 +493,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 @@ -550,10 +549,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"); end |