From 16c2ef22e048290e88134877c0104d3263481862 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 22 Nov 2021 14:49:05 +0100 Subject: mod_muc_mam: Switch to mod_cron for message expiry --- plugins/mod_muc_mam.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'plugins/mod_muc_mam.lua') 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 -- cgit v1.2.3