diff options
author | Andrew Dolgov <[email protected]> | 2017-05-06 10:54:14 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-05-06 10:54:14 +0300 |
commit | 4fd0790804191dac3247430cc3bd7053ae7d32ca (patch) | |
tree | 623a584dc90470c47231ab5ec99ca3582407c855 /update.php | |
parent | e6c886bf66928d4bd496672f12b79b547747677b (diff) |
fix DAEMON_SLEEP_INTERVAL not being defined when used
enforce minimum 60 sec spawn/sleep interval in update processes
Diffstat (limited to 'update.php')
-rwxr-xr-x | update.php | 8 |
1 files changed, 6 insertions, 2 deletions
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); } } |