From 4fd0790804191dac3247430cc3bd7053ae7d32ca Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 6 May 2017 10:54:14 +0300 Subject: fix DAEMON_SLEEP_INTERVAL not being defined when used enforce minimum 60 sec spawn/sleep interval in update processes --- update.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'update.php') diff --git a/update.php b/update.php index fe2b3c572..9012d717b 100755 --- a/update.php +++ b/update.php @@ -181,8 +181,12 @@ $log = isset($options['log']) ? '--log '.$options['log'] : ''; passthru(PHP_EXECUTABLE . " " . $argv[0] ." --daemon-loop $quiet $log"); - _debug("Sleeping for " . DAEMON_SLEEP_INTERVAL . " seconds..."); - sleep(DAEMON_SLEEP_INTERVAL); + + // let's enforce a minimum spawn interval as to not forkbomb the host + $spawn_interval = max(60, DAEMON_SLEEP_INTERVAL); + + _debug("Sleeping for $spawn_interval seconds..."); + sleep($spawn_interval); } } -- cgit v1.2.3-54-g00ecf