From 9ec4f42888bc2fffd55d098c4d4649a289c915a5 Mon Sep 17 00:00:00 2001 From: Daniel Poelzleithner Date: Wed, 30 Mar 2022 23:07:45 +0200 Subject: [PATCH] Only check Tunnels if there is at least one tunnel defined --- lsyncd.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lsyncd.lua b/lsyncd.lua index 3d7b736..a698612 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -3427,7 +3427,7 @@ Tunnel = (function() ready = false, retryCount = 0, status = TUNNEL_STATUS.DOWN, - alarm = false, + alarm = true, rrCounter = 0, } -- provides a default name if needed @@ -3906,7 +3906,7 @@ local Tunnels = ( function return #tunnelList end - local nextCycle = false + local nextCycle = true -- -- Cycle through all tunnels and call their invoke function -- @@ -3915,7 +3915,11 @@ local Tunnels = ( function do tunnel:invoke(timestamp) end - nextCycle = now() + 5 + if size() > 0 then + nextCycle = now() + 5 + else + nextCycle = false + end end --