]> git.wh0rd.org - tt-rss.git/blobdiff - update_daemon2.php
code cleanup, test for db_escape() crazyness in DB sanity check
[tt-rss.git] / update_daemon2.php
index 1b4007ac8c15b5b7c2ac150901a93b027c717889..08f5d74c3e292c4be6c0544d1120dfb4f4114c29 100644 (file)
@@ -12,8 +12,6 @@
        define('SIMPLEPIE_CACHE_DIR',   '/var/tmp/simplepie-ttrss-cache-daemon');
        define('DISABLE_SESSIONS', true);
 
-       define('MAX_JOBS', 2);
-
        require_once "version.php";
 
        if (strpos(VERSION, ".99") !== false || getenv('DAEMON_XDEBUG')) {
@@ -25,6 +23,8 @@
        require_once "sanity_check.php";
        require_once "config.php";
 
+       define('MAX_JOBS', 2);
+
        define('SPAWN_INTERVAL', DAEMON_SLEEP_INTERVAL);
 
        if (!ENABLE_UPDATE_DAEMON) {
 
        db_close($link);
 
-
        while (true) {
 
                // Since sleep is interupted by SIGCHLD, we need another way to
                                                return;
                                        }
 
-                                       if (DB_TYPE == "pgsql") {
-                                               pg_query("set client_encoding = 'utf-8'");
-                                               pg_set_client_encoding("UNICODE");
-                                       } else {
-                                               if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) {
-                                                       db_query($link, "SET NAMES " . MYSQL_CHARSET);
-                                                       // db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET);
-                                               }
-                                       }
+                                       init_connection($link);
 
                                        // We disable stamp file, since it is of no use in a multiprocess update.
                                        // not really, tho for the time being -fox