do not flood log about waiting for processes. Fixing retry startup of rsyncssh

This commit is contained in:
Axel Kittenberger 2012-10-23 14:31:54 +02:00
parent 4a7bf07f4f
commit beaa258ad0
2 changed files with 21 additions and 8 deletions

View File

@ -206,7 +206,7 @@ rsyncssh.collect = function( agent, exitcode )
if rc == 'ok' then
log('Normal', 'Startup of "',agent.source,'" finished: ', exitcode)
elseif rc == 'again' then
if settings.insist then
if uSettings.insist then
log('Normal', 'Retrying startup of "',agent.source,'": ', exitcode)
else
log('Error', 'Temporary or permanent failure on startup of "',

View File

@ -3386,6 +3386,11 @@ local lsyncdStatus = 'init'
--
local runner = { }
--
-- Last time said to be waiting for more child processes
--
local lastReportedWaiting = false
--
-- Called from core whenever Lua code failed.
--
@ -3452,12 +3457,19 @@ function runner.cycle(
if processCount > 0 then
if
lastReportedWaiting == false or
timestamp >= lastReportedWaiting + 60
then
lastReportedWaiting = timestamp
log(
'Normal',
'waiting for ',
processCount,
' more child processes.'
)
end
return true
else
@ -3467,7 +3479,6 @@ function runner.cycle(
end
if lsyncdStatus ~= 'run' then
error( 'runner.cycle() called while not running!' )
end
@ -3804,6 +3815,8 @@ function runner.initialize( firstTime )
end
lastReportedWaiting = false
--
-- From this point on, no globals may be created anymore
--