aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_smacks.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index d4f0f371..7a9a67b3 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -541,11 +541,13 @@ module:hook("pre-resource-unbind", function (event)
return
end
- 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);
+ 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);
end);
if session.conn then
local conn = session.conn;