diff util/watchdog.lua @ 12547:e79c64b2dfed

util.watchdog: Allow passing a new timeout to :reset()
author Matthew Wild <mwild1@gmail.com>
date Sat, 11 Jun 2022 22:15:31 +0100
parents e78b35574aae
children d10957394a3c
line wrap: on
line diff
--- a/util/watchdog.lua	Sat Jun 11 22:15:14 2022 +0100
+++ b/util/watchdog.lua	Sat Jun 11 22:15:31 2022 +0100
@@ -19,7 +19,10 @@
 	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