From b9aca76353127d6800b046cee8782bb72e9e555a Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Wed, 13 Dec 2023 12:23:12 +0100 Subject: [PATCH] disabling watchdog temporarily --- lib/rsmp/proxy.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/rsmp/proxy.rb b/lib/rsmp/proxy.rb index aed6c18a..eb9fcee5 100644 --- a/lib/rsmp/proxy.rb +++ b/lib/rsmp/proxy.rb @@ -222,6 +222,20 @@ def start_watchdog @watchdog_started = true end + def stop_watchdog + log "Stopping watchdog", level: :debug + @watchdog_started = false + end + + def with_watchdog_disabled + was = @watchdog_started + stop_watchdog if was + yield + ensure + start_watchdog if was + end + + def start_timer return if @timer name = "timer"