]> git.wh0rd.org - tt-rss.git/blobdiff - update.php
pluginhost: save_data() fixes
[tt-rss.git] / update.php
index fe2b3c572373189638533af61592b53b16d2e66f..7104f760a7265f39faeb556432ffba71a1d2b8f2 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);
                }
        }
 
        if (isset($options["update-schema"])) {
                _debug("checking for updates (" . DB_TYPE . ")...");
 
-               $updater = new DbUpdater(Db::get(), DB_TYPE, SCHEMA_VERSION);
+               $updater = new DbUpdater(Db::pdo(), DB_TYPE, SCHEMA_VERSION);
 
                if ($updater->isUpdateRequired()) {
                        _debug("schema update required, version " . $updater->getSchemaVersion() . " to " . SCHEMA_VERSION);