diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_smacks.lua | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua index 2b131031..65d410e0 100644 --- a/plugins/mod_smacks.lua +++ b/plugins/mod_smacks.lua @@ -541,13 +541,17 @@ module:hook("pre-resource-unbind", function (event) return end - prosody.main_thread:run(function () - session.log("debug", "Destroying session for hibernating too long"); - save_old_session(session); - session.resumption_token = nil; - sessionmanager.destroy_session(session, "Hibernating too long"); - sessions_expired(1); - end); + session.thread:run({ + event = "callback"; + name = "mod_smacks/destroy_hibernating"; + callback = function () + session.log("debug", "Destroying session for hibernating too long"); + save_old_session(session); + session.resumption_token = nil; + sessionmanager.destroy_session(session, "Hibernating too long"); + sessions_expired(1); + end; + }); end); if session.conn then local conn = session.conn; |