aboutsummaryrefslogtreecommitdiffstats
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
commitf17b76ce487a90598c67f1e43e451d45f3e3a946 (patch)
tree35265a89d9b207f7cd1d28b2543b4349e4d9cc55
parentd30f224c1cde9833d449ba98bea1d1526901d6e6 (diff)
downloadprosody-f17b76ce487a90598c67f1e43e451d45f3e3a946.tar.gz
prosody-f17b76ce487a90598c67f1e43e451d45f3e3a946.zip
mod_muc_mam: Measure how long a cleanup run takes (like mod_mam)
-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 ()