diff options
author | Kim Alvefur <zash@zash.se> | 2021-12-31 00:18:13 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-12-31 00:18:13 +0100 |
commit | 88da8ef1a04a6541e7bd049315279bcbc96ef8a9 (patch) | |
tree | 7cdca581df5c973b6396bd6f26c10770deea6bce /plugins/mod_smacks.lua | |
parent | 67104202897cf5efcec95aaac2550efd37069e1f (diff) | |
download | prosody-88da8ef1a04a6541e7bd049315279bcbc96ef8a9.tar.gz prosody-88da8ef1a04a6541e7bd049315279bcbc96ef8a9.zip |
mod_smacks: Record timestamp with persisted counters
For future cleanup routine when people inevitably complain about this
data being stored there forever
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r-- | plugins/mod_smacks.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua index 23fc5054..c6d33efa 100644 --- a/plugins/mod_smacks.lua +++ b/plugins/mod_smacks.lua @@ -467,7 +467,8 @@ module:hook("pre-resource-unbind", function (event) session.log("debug", "Destroying session for hibernating too long"); session_registry[jid.join(session.username, session.host, session.resumption_token)] = nil; - old_session_registry:set(session.username, session.resumption_token, { h = session.handled_stanza_count }); + old_session_registry:set(session.username, session.resumption_token, + { h = session.handled_stanza_count; t = os.time() }); session.resumption_token = nil; session.resending_unacked = true; -- stop outgoing_stanza_filter from re-queueing anything anymore sessionmanager.destroy_session(session, "Hibernating too long"); @@ -681,7 +682,8 @@ module:hook_global("server-stopping", function(event) for _, user in pairs(local_sessions) do for _, session in pairs(user.sessions) do if session.resumption_token then - if old_session_registry:set(session.username, session.resumption_token, { h = session.handled_stanza_count }) then + if old_session_registry:set(session.username, session.resumption_token, + { h = session.handled_stanza_count; t = os.time() }) then session.resumption_token = nil; -- Deal with unacked stanzas |