aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-04-04 08:55:15 +0200
committerKim Alvefur <zash@zash.se>2023-04-04 08:55:15 +0200
commite49554a4220ef763bc17f966d27b78f9f581c9d3 (patch)
treea237e9df0b38612ebe921df37dd3ea0f2abdfadb /plugins
parentade5f403711f58aa07828b8cacfb2c8943f58163 (diff)
parentd840f273201196765e75c97370efa4cd2ed8d75d (diff)
downloadprosody-e49554a4220ef763bc17f966d27b78f9f581c9d3.tar.gz
prosody-e49554a4220ef763bc17f966d27b78f9f581c9d3.zip
Merge 0.12->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_smacks.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index 34480f7c..c432ebda 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -521,7 +521,16 @@ module:hook("pre-resource-unbind", function (event)
if session.hibernating then return end
session.hibernating = os_time();
- session.hibernating_watchdog = watchdog.new(resume_timeout, function()
+ if session.hibernating_watchdog then
+ session.log("debug", "Session already has a sleeping watchdog, replacing it");
+ session.hibernating_watchdog:cancel();
+ end
+ session.hibernating_watchdog = watchdog.new(resume_timeout, function(this_dog)
+ if this_dog ~= session.hibernating_watchdog then
+ -- This really shouldn't happen?
+ session.log("debug", "Releasing a stray watchdog");
+ return
+ end
session.log("debug", "mod_smacks hibernation timeout reached...");
if session.destroyed then
session.log("debug", "The session has already been destroyed");