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,
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

View File

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

View File

@ -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
(

View File

@ -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
)

View File

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

View File

@ -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' )