]> git.wh0rd.org - tt-rss.git/blobdiff - update_daemon2.php
sanity check: properly check for ISCONFIGURED
[tt-rss.git] / update_daemon2.php
index c8556a61e6d499b1bbe223f2d6a039db03df9f9e..63f218cc4961692765ea068c209a6ecb395650db 100755 (executable)
@@ -3,9 +3,6 @@
        // This is an experimental multiprocess update daemon.
        // Some configurable variable may be found below.
 
-       // define('DEFAULT_ERROR_LEVEL', E_ALL);
-       define('DEFAULT_ERROR_LEVEL', E_ERROR | E_WARNING | E_PARSE);
-
        declare(ticks = 1);
 
        define('DISABLE_SESSIONS', true);
@@ -38,8 +35,6 @@
        require_once "functions.php";
        require_once "lib/magpierss/rss_fetch.inc";
 
-       error_reporting(DEFAULT_ERROR_LEVEL);
-
        $children = array();
        $ctimes = array();
 
@@ -53,7 +48,8 @@
 
                foreach ($children as $pid) {
                        if (pcntl_waitpid($pid, $status, WNOHANG) != $pid) {
-                               if (file_is_locked(LOCK_DIRECTORY . "/update_daemon-$pid.lock")) {
+
+                               if (file_is_locked("update_daemon-$pid.lock")) {
                                        array_push($tmp, $pid);
                                } else {
                                        _debug("[reap_children] child $pid seems active but lockfile is unlocked.");
                                                update_daemon_common($link);
                                        } else {
                                                $count = update_feedbrowser_cache($link);
-                                               _debug("Finished, $count feeds processed.");
+                                               _debug("Feedbrowser updated, $count feeds processed.");
+
+                                               purge_orphans($link, true);
+
+                                               $rc = cleanup_tags($link, 14, 50000);
+
+                                               _debug("Cleaned $rc cached tags.");
+
                                        }
 
                                        _debug("Elapsed time: " . (time() - $start_timestamp) . " second(s)");