<?php
-define_default('DAEMON_UPDATE_LOGIN_LIMIT', 30);
-define_default('DAEMON_FEED_LIMIT', 500);
-define_default('DAEMON_SLEEP_INTERVAL', 120);
-define_default('_MIN_CACHE_FILE_SIZE', 1024);
-
class RSSUtils {
static function calculate_article_hash($article, $pluginhost) {
$tmp = "";
// How many seconds to wait for initial response from website when
// fetching files from remote sites
+ // feed updating stuff
+ define_default('DAEMON_UPDATE_LOGIN_LIMIT', 30);
+ define_default('DAEMON_FEED_LIMIT', 500);
+ define_default('DAEMON_SLEEP_INTERVAL', 120);
+ define_default('_MIN_CACHE_FILE_SIZE', 1024);
+
if (DB_TYPE == "pgsql") {
define('SUBSTRING_FOR_DATE', 'SUBSTRING_FOR_DATE');
} else {
$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);
}
}
$spawn_interval = SPAWN_INTERVAL;
}
+ // let's enforce a minimum spawn interval as to not forkbomb the host
+ $spawn_interval = max(60, $spawn_interval);
+ _debug("Spawn interval: $spawn_interval sec");
+
if (isset($options["log"])) {
_debug("Logging to " . $options["log"]);
define('LOGFILE', $options["log"]);