aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-06-11 22:15:31 +0100
committerMatthew Wild <mwild1@gmail.com>2022-06-11 22:15:31 +0100
commit7532eac0e5e4cd51a765498bdcca2d52b0b3ca7a (patch)
tree9ec79c8f1b456c71145306d9a3f35cbe6263b9c9
parent029e0934783a60cf0be8c08e982440205fa9d337 (diff)
downloadprosody-7532eac0e5e4cd51a765498bdcca2d52b0b3ca7a.tar.gz
prosody-7532eac0e5e4cd51a765498bdcca2d52b0b3ca7a.zip
util.watchdog: Allow passing a new timeout to :reset()
-rw-r--r--util/watchdog.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/watchdog.lua b/util/watchdog.lua
index 6eb2e602..407028a5 100644
--- a/util/watchdog.lua
+++ b/util/watchdog.lua
@@ -19,7 +19,10 @@ local function new(timeout, callback)
return watchdog;
end
-function watchdog_methods:reset()
+function watchdog_methods:reset(new_timeout)
+ if new_timeout then
+ self.timeout = new_timeout;
+ end
if self.timer_id then
timer.reschedule(self.timer_id, self.timeout+1);
else