From 455c68877a08f4918728af23d14daba613cfcb8d Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Mon, 2 Jul 2018 08:43:07 +0200 Subject: [PATCH] cleanups --- default/proto.lua | 5 +++-- mantle/delay.lua | 1 - mantle/inlet.lua | 3 ++- mantle/sync.lua | 10 +++++----- tests/churn-rsync.lua | 1 + tests/churn-rsyncssh.lua | 5 ++++- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/default/proto.lua b/default/proto.lua index 2844c9d..e253e15 100644 --- a/default/proto.lua +++ b/default/proto.lua @@ -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 + diff --git a/mantle/delay.lua b/mantle/delay.lua index 709d846..fa06836 100644 --- a/mantle/delay.lua +++ b/mantle/delay.lua @@ -35,7 +35,6 @@ local k_nt = { } local assignable = { dpos = true, - etype = true, status = true, } diff --git a/mantle/inlet.lua b/mantle/inlet.lua index 4f47037..a498294 100644 --- a/mantle/inlet.lua +++ b/mantle/inlet.lua @@ -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 ( diff --git a/mantle/sync.lua b/mantle/sync.lua index 6c05b0e..fe95547 100644 --- a/mantle/sync.lua +++ b/mantle/sync.lua @@ -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 ) diff --git a/tests/churn-rsync.lua b/tests/churn-rsync.lua index 0bc9200..14568d4 100644 --- a/tests/churn-rsync.lua +++ b/tests/churn-rsync.lua @@ -20,6 +20,7 @@ local pid = spawn( 'sync{ ' .. 'default.rsync, ' .. 'delay = 5, ' + .. 'delete = true, ' .. 'source = "'..srcdir..'", ' .. 'target = "'..trgdir..'" ' .. '}', diff --git a/tests/churn-rsyncssh.lua b/tests/churn-rsyncssh.lua index dacbe88..fc10d7c 100644 --- a/tests/churn-rsyncssh.lua +++ b/tests/churn-rsyncssh.lua @@ -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' )