mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-13 14:43:09 +00:00
Call user provideable check function
This commit is contained in:
parent
cf7cfe1bda
commit
d708dca0f2
@ -3305,9 +3305,9 @@ Tunnel = (function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Check if the tunnel is up
|
-- User supplied function to check if tunnel is up
|
||||||
function Tunnel:check()
|
function Tunnel:check()
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function Tunnel:isReady()
|
function Tunnel:isReady()
|
||||||
@ -3318,6 +3318,11 @@ Tunnel = (function()
|
|||||||
-- Check if the tunnel is up
|
-- Check if the tunnel is up
|
||||||
function Tunnel:invoke(timestamp)
|
function Tunnel:invoke(timestamp)
|
||||||
-- lsyncd.kill()
|
-- lsyncd.kill()
|
||||||
|
if self:check() == false then
|
||||||
|
-- check failed, consider tunnel broken
|
||||||
|
self.status = TUNNEL_STATUS.DOWN
|
||||||
|
end
|
||||||
|
|
||||||
-- check if child processes are running
|
-- check if child processes are running
|
||||||
if self.status == TUNNEL_STATUS.CONNECTING then
|
if self.status == TUNNEL_STATUS.CONNECTING then
|
||||||
-- we can only be good if processes exist
|
-- we can only be good if processes exist
|
||||||
|
Loading…
Reference in New Issue
Block a user