mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-13 14:43:09 +00:00
do not flood log about waiting for processes. Fixing retry startup of rsyncssh
This commit is contained in:
parent
4a7bf07f4f
commit
beaa258ad0
@ -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 "',
|
||||
|
15
lsyncd.lua
15
lsyncd.lua
@ -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
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user