mirror of
https://github.com/bjc/prosody.git
synced 2025-04-06 22:57:38 +03:00
mod_smacks: Record timestamp with persisted counters
For future cleanup routine when people inevitably complain about this data being stored there forever
This commit is contained in:
parent
6710420289
commit
88da8ef1a0
1 changed files with 4 additions and 2 deletions
|
@ -467,7 +467,8 @@ module:hook("pre-resource-unbind", function (event)
|
||||||
|
|
||||||
session.log("debug", "Destroying session for hibernating too long");
|
session.log("debug", "Destroying session for hibernating too long");
|
||||||
session_registry[jid.join(session.username, session.host, session.resumption_token)] = nil;
|
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.resumption_token = nil;
|
||||||
session.resending_unacked = true; -- stop outgoing_stanza_filter from re-queueing anything anymore
|
session.resending_unacked = true; -- stop outgoing_stanza_filter from re-queueing anything anymore
|
||||||
sessionmanager.destroy_session(session, "Hibernating too long");
|
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 _, user in pairs(local_sessions) do
|
||||||
for _, session in pairs(user.sessions) do
|
for _, session in pairs(user.sessions) do
|
||||||
if session.resumption_token then
|
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;
|
session.resumption_token = nil;
|
||||||
|
|
||||||
-- Deal with unacked stanzas
|
-- Deal with unacked stanzas
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue