diff options
author | Kim Alvefur <zash@zash.se> | 2019-01-06 09:34:59 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-01-06 09:34:59 +0100 |
commit | 2ac699495592895c1cde86cb0ba2dc25c254a4eb (patch) | |
tree | 0664457c3c56866066320810ca02553262a9ddb1 | |
parent | 51c4d0a0e4d0b1d83bdcfc779bcc9e83be4f3d08 (diff) | |
download | prosody-2ac699495592895c1cde86cb0ba2dc25c254a4eb.tar.gz prosody-2ac699495592895c1cde86cb0ba2dc25c254a4eb.zip |
mod_mam: Measure how long it takes to run the message expiry job job
-rw-r--r-- | plugins/mod_mam/mod_mam.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index 35a4b9a0..5ba04d68 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -351,8 +351,10 @@ if cleanup_after ~= "never" then function schedule_cleanup(username, date) cleanup_map:set(date or datestamp(), username, true); end + local cleanup_time = module:measure("cleanup", "times"); cleanup_runner = require "util.async".runner(function () + local cleanup_done = cleanup_time(); local users = {}; local cut_off = datestamp(os.time() - cleanup_after); for date in cleanup_storage:users() do @@ -376,6 +378,7 @@ if cleanup_after ~= "never" then end end module:log("info", "Deleted %d expired messages for %d users", sum, num_users); + cleanup_done(); end); cleanup_task = module:add_timer(1, function () |