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 if rc == 'ok' then
log('Normal', 'Startup of "',agent.source,'" finished: ', exitcode) log('Normal', 'Startup of "',agent.source,'" finished: ', exitcode)
elseif rc == 'again' then elseif rc == 'again' then
if settings.insist then if uSettings.insist then
log('Normal', 'Retrying startup of "',agent.source,'": ', exitcode) log('Normal', 'Retrying startup of "',agent.source,'": ', exitcode)
else else
log('Error', 'Temporary or permanent failure on startup of "', log('Error', 'Temporary or permanent failure on startup of "',

View File

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