]> git.wh0rd.org - tt-rss.git/blobdiff - update.php
fix DAEMON_SLEEP_INTERVAL not being defined when used
[tt-rss.git] / update.php
index fe2b3c572373189638533af61592b53b16d2e66f..9012d717b29fc35eae449798ff618418a3a41862 100755 (executable)
          $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);
                }
        }