aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-01-04 14:05:10 +0100
committerKim Alvefur <zash@zash.se>2020-01-04 14:05:10 +0100
commit71138a9fd9d1b1e5767409be50d1547359e0d186 (patch)
tree35265a89d9b207f7cd1d28b2543b4349e4d9cc55 /plugins
parentcd9906cb2d3d5ec8801a5d2d5a832a3cb5009259 (diff)
downloadprosody-71138a9fd9d1b1e5767409be50d1547359e0d186.tar.gz
prosody-71138a9fd9d1b1e5767409be50d1547359e0d186.zip
mod_muc_mam: Measure how long a cleanup run takes (like mod_mam)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_muc_mam.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_muc_mam.lua b/plugins/mod_muc_mam.lua
index fee75e33..e7506bbb 100644
--- a/plugins/mod_muc_mam.lua
+++ b/plugins/mod_muc_mam.lua
@@ -481,7 +481,10 @@ if cleanup_after ~= "never" then
end
end
+ local cleanup_time = module:measure("cleanup", "times");
+
cleanup_runner = require "util.async".runner(function ()
+ local cleanup_done = cleanup_time();
local rooms = {};
local cut_off = datestamp(os.time() - cleanup_after);
for date in cleanup_storage:users() do
@@ -512,6 +515,7 @@ if cleanup_after ~= "never" then
end
end
module:log("info", "Deleted %d expired messages for %d rooms", sum, num_rooms);
+ cleanup_done();
end);
cleanup_task = module:add_timer(1, function ()