# HG changeset patch # User Kim Alvefur # Date 1680591315 -7200 # Node ID cbe58f747d487853a5419b76bd6f119ed45ba1cd # Parent 3174308d127e3e23121679c1cf734d23a866ce59# Parent a313b72601459547f7497fe174428c388915cbc4 Merge 0.12->trunk diff -r 3174308d127e -r cbe58f747d48 plugins/mod_smacks.lua --- a/plugins/mod_smacks.lua Sun Apr 02 21:58:53 2023 +0200 +++ b/plugins/mod_smacks.lua Tue Apr 04 08:55:15 2023 +0200 @@ -521,7 +521,16 @@ 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");