# HG changeset patch # User Kim Alvefur # Date 1640906293 -3600 # Node ID fa804c2db747792c1d7fed61b4a2f71dbf27d92d # Parent 912614c4bf3e6c33af03af99d44c113a4cd9b226 mod_smacks: Record timestamp with persisted counters For future cleanup routine when people inevitably complain about this data being stored there forever diff -r 912614c4bf3e -r fa804c2db747 plugins/mod_smacks.lua --- a/plugins/mod_smacks.lua Wed Dec 29 18:03:26 2021 +0100 +++ b/plugins/mod_smacks.lua Fri Dec 31 00:18:13 2021 +0100 @@ -467,7 +467,8 @@ 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 @@ 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