mirror of
https://github.com/octoleo/lsyncd.git
synced 2025-01-09 01:44:16 +00:00
fixes
This commit is contained in:
parent
5d75b80403
commit
cbfed8ee99
@ -11,8 +11,8 @@ local rsyncpostcmd = {
|
|||||||
-- based on default rsync.
|
-- based on default rsync.
|
||||||
default.rsync,
|
default.rsync,
|
||||||
|
|
||||||
-- for this config it is important to keep maxProcesses at 1, so
|
-- for this config it is important to keep maxProcesses at 1, so
|
||||||
-- the postcmds will only be spawned after the rsync completed
|
-- the postcmds will only be spawned after the rsync completed
|
||||||
maxProcesses = 1,
|
maxProcesses = 1,
|
||||||
|
|
||||||
-- called whenever something is to be done
|
-- called whenever something is to be done
|
||||||
@ -22,11 +22,12 @@ local rsyncpostcmd = {
|
|||||||
-- if the event is a blanket event and not the startup,
|
-- if the event is a blanket event and not the startup,
|
||||||
-- its there to spawn the webservice restart at the target.
|
-- its there to spawn the webservice restart at the target.
|
||||||
if event.etype == "Blanket" then
|
if event.etype == "Blanket" then
|
||||||
-- uses rawget to test if "isRestart" has been set without
|
-- uses rawget to test if "isPostcmd" has been set without
|
||||||
-- triggering an error if not.
|
-- triggering an error if not.
|
||||||
local isPostcmd = rawget(event, "isPostcmd")
|
local isPostcmd = rawget(event, "isPostcmd")
|
||||||
if event.isPostcmd then
|
if event.isPostcmd then
|
||||||
spawn(event, "/usr/bin/ssh", config.host, config.postcmd)
|
spawn(event, "/usr/bin/ssh",
|
||||||
|
config.host, config.postcmd)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
-- this is the startup, forwards it to default routine.
|
-- this is the startup, forwards it to default routine.
|
||||||
@ -34,7 +35,7 @@ local rsyncpostcmd = {
|
|||||||
end
|
end
|
||||||
error("this should never be reached")
|
error("this should never be reached")
|
||||||
end
|
end
|
||||||
-- for any other event, a blanket event is created that
|
-- for any other event, a blanket event is created that
|
||||||
-- will stack on the queue and do the postcmd when its finished
|
-- will stack on the queue and do the postcmd when its finished
|
||||||
local sync = inlet.createBlanketEvent()
|
local sync = inlet.createBlanketEvent()
|
||||||
sync.isPostcmd = true
|
sync.isPostcmd = true
|
||||||
|
Loading…
Reference in New Issue
Block a user