This commit is contained in:
Axel Kittenberger 2018-07-02 08:43:07 +02:00
parent b030d4b898
commit 455c68877a
6 changed files with 15 additions and 10 deletions

View File

@ -32,7 +32,7 @@ proto.checkgauge =
init = true, init = true,
maxDelays = true, maxDelays = true,
maxProcesses = true, maxProcesses = true,
mindelay = true, minDelay = true,
onAttrib = true, onAttrib = true,
onCreate = true, onCreate = true,
onModify = true, onModify = true,
@ -300,4 +300,5 @@ end
-- --
-- Default minimum 1 second delay to do anything -- Default minimum 1 second delay to do anything
-- --
proto.mindelay = 1 proto.minDelay = 1

View File

@ -35,7 +35,6 @@ local k_nt = { }
local assignable = local assignable =
{ {
dpos = true, dpos = true,
etype = true,
status = true, status = true,
} }

View File

@ -627,7 +627,8 @@ local inletFuncs =
end, 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 getEvents = function
( (

View File

@ -608,8 +608,8 @@ local function getNextDelay
do do
if #self.delays < self.config.maxDelays if #self.delays < self.config.maxDelays
then then
-- time constrains are only concerned if not maxed -- time constrains are only concerned
-- the delay FIFO already. -- if not maxed the delay FIFO already.
if d.alarm ~= true and timestamp < d.alarm if d.alarm ~= true and timestamp < d.alarm
then then
-- reached point in stack where delays are in future -- reached point in stack where delays are in future
@ -845,13 +845,13 @@ local function new
end end
-- this is written in a negated way -- 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 -- not being numbers as well
if not ( config.mindelay <= config.delay ) if not ( config.minDelay <= config.delay )
then then
error( error(
'mindelay (= '..config.mindelay.. ') must be smaller '.. 'minDelay (= '..config.minDelay.. ') must be smaller '..
'or equal than delay (= '..config.delay..')', 'or equal than delay (= '..config.delay..')',
level level
) )

View File

@ -20,6 +20,7 @@ local pid = spawn(
'sync{ ' 'sync{ '
.. 'default.rsync, ' .. 'default.rsync, '
.. 'delay = 5, ' .. 'delay = 5, '
.. 'delete = true, '
.. 'source = "'..srcdir..'", ' .. 'source = "'..srcdir..'", '
.. 'target = "'..trgdir..'" ' .. 'target = "'..trgdir..'" '
.. '}', .. '}',

View File

@ -17,7 +17,8 @@ local tdir, srcdir, trgdir = mktemps()
churn( srcdir, 5, true ) churn( srcdir, 5, true )
local logs = {} local logs = {}
logs = { '-log', 'Delay' } -- logs = { '-log', 'Delay' }
logs = { '-log', 'Exec' }
local pid = spawn( local pid = spawn(
'./lsyncd', './lsyncd',
@ -25,6 +26,7 @@ local pid = spawn(
'sync{ ' 'sync{ '
.. 'default.rsyncssh, ' .. 'default.rsyncssh, '
.. 'delay = 5, ' .. 'delay = 5, '
.. 'delete = true, '
.. 'source = "'..srcdir..'", ' .. 'source = "'..srcdir..'", '
.. 'host = "localhost", ' .. 'host = "localhost", '
.. 'targetdir = "'..trgdir..'" ' .. 'targetdir = "'..trgdir..'" '
@ -38,6 +40,7 @@ posix.sleep( 1 )
churn( srcdir, 100, false ) churn( srcdir, 100, false )
cwriteln( 'waiting for Lsyncd to finish its jobs.' ) cwriteln( 'waiting for Lsyncd to finish its jobs.' )
posix.sleep( 10 ) posix.sleep( 10 )
cwriteln( 'killing the Lsyncd daemon' ) cwriteln( 'killing the Lsyncd daemon' )