mirror of https://github.com/octoleo/lsyncd.git
cleanups
This commit is contained in:
parent
b030d4b898
commit
455c68877a
|
@ -32,7 +32,7 @@ proto.checkgauge =
|
|||
init = true,
|
||||
maxDelays = true,
|
||||
maxProcesses = true,
|
||||
mindelay = true,
|
||||
minDelay = true,
|
||||
onAttrib = true,
|
||||
onCreate = true,
|
||||
onModify = true,
|
||||
|
@ -300,4 +300,5 @@ end
|
|||
--
|
||||
-- Default minimum 1 second delay to do anything
|
||||
--
|
||||
proto.mindelay = 1
|
||||
proto.minDelay = 1
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ local k_nt = { }
|
|||
local assignable =
|
||||
{
|
||||
dpos = true,
|
||||
etype = true,
|
||||
status = true,
|
||||
}
|
||||
|
||||
|
|
|
@ -627,7 +627,8 @@ local inletFuncs =
|
|||
end,
|
||||
|
||||
--
|
||||
-- Gets all events that are not blocked by active events.
|
||||
-- Gets all events that are not blocked by active events
|
||||
-- and which minDelay has passed
|
||||
--
|
||||
getEvents = function
|
||||
(
|
||||
|
|
|
@ -608,8 +608,8 @@ local function getNextDelay
|
|||
do
|
||||
if #self.delays < self.config.maxDelays
|
||||
then
|
||||
-- time constrains are only concerned if not maxed
|
||||
-- the delay FIFO already.
|
||||
-- time constrains are only concerned
|
||||
-- if not maxed the delay FIFO already.
|
||||
if d.alarm ~= true and timestamp < d.alarm
|
||||
then
|
||||
-- reached point in stack where delays are in future
|
||||
|
@ -845,13 +845,13 @@ local function new
|
|||
end
|
||||
|
||||
-- this is written in a negated way
|
||||
-- since this way it will raise any issues of mindelay or delay
|
||||
-- since this way it will raise any issues of minDelay or delay
|
||||
-- not being numbers as well
|
||||
|
||||
if not ( config.mindelay <= config.delay )
|
||||
if not ( config.minDelay <= config.delay )
|
||||
then
|
||||
error(
|
||||
'mindelay (= '..config.mindelay.. ') must be smaller '..
|
||||
'minDelay (= '..config.minDelay.. ') must be smaller '..
|
||||
'or equal than delay (= '..config.delay..')',
|
||||
level
|
||||
)
|
||||
|
|
|
@ -20,6 +20,7 @@ local pid = spawn(
|
|||
'sync{ '
|
||||
.. 'default.rsync, '
|
||||
.. 'delay = 5, '
|
||||
.. 'delete = true, '
|
||||
.. 'source = "'..srcdir..'", '
|
||||
.. 'target = "'..trgdir..'" '
|
||||
.. '}',
|
||||
|
|
|
@ -17,7 +17,8 @@ local tdir, srcdir, trgdir = mktemps()
|
|||
churn( srcdir, 5, true )
|
||||
|
||||
local logs = {}
|
||||
logs = { '-log', 'Delay' }
|
||||
-- logs = { '-log', 'Delay' }
|
||||
logs = { '-log', 'Exec' }
|
||||
|
||||
local pid = spawn(
|
||||
'./lsyncd',
|
||||
|
@ -25,6 +26,7 @@ local pid = spawn(
|
|||
'sync{ '
|
||||
.. 'default.rsyncssh, '
|
||||
.. 'delay = 5, '
|
||||
.. 'delete = true, '
|
||||
.. 'source = "'..srcdir..'", '
|
||||
.. 'host = "localhost", '
|
||||
.. 'targetdir = "'..trgdir..'" '
|
||||
|
@ -38,6 +40,7 @@ posix.sleep( 1 )
|
|||
churn( srcdir, 100, false )
|
||||
|
||||
cwriteln( 'waiting for Lsyncd to finish its jobs.' )
|
||||
|
||||
posix.sleep( 10 )
|
||||
|
||||
cwriteln( 'killing the Lsyncd daemon' )
|
||||
|
|
Loading…
Reference in New Issue