]> git.wh0rd.org - tt-rss.git/blobdiff - classes/rpc.php
make globalUpdateFeeds handler use simple update mechanism to prevent script timeouts
[tt-rss.git] / classes / rpc.php
index 46583feb58469d333e6b97489eeebe6920575d58..cfd9c4f22388f30cb88a16e876f8d106b4075656 100644 (file)
@@ -467,14 +467,6 @@ class RPC extends Handler_Protected {
                print_feed_cat_select("cat_id", $id, '');
        }
 
-       // Silent
-       function clearArticleKeys() {
-               $this->dbh->query("UPDATE ttrss_user_entries SET uuid = '' WHERE
-                       owner_uid = " . $_SESSION["uid"]);
-
-               return;
-       }
-
        function setpanelmode() {
                $wide = (int) $_REQUEST["wide"];
 
@@ -484,7 +476,8 @@ class RPC extends Handler_Protected {
                print json_encode(array("wide" => $wide));
        }
 
-       function updaterandomfeed() {
+       static function updaterandomfeed_real($dbh) {
+
                // Test if the feed need a update (update interval exceded).
                if (DB_TYPE == "pgsql") {
                        $update_limit_qpart = "AND ((
@@ -516,7 +509,7 @@ class RPC extends Handler_Protected {
                $random_qpart = sql_random_function();
 
                // We search for feed needing update.
-               $result = $this->dbh->query("SELECT ttrss_feeds.feed_url,ttrss_feeds.id
+               $result = $dbh->query("SELECT ttrss_feeds.feed_url,ttrss_feeds.id
                        FROM
                                ttrss_feeds, ttrss_users, ttrss_user_prefs
                        WHERE
@@ -535,7 +528,7 @@ class RPC extends Handler_Protected {
 
                $tstart = time();
 
-               while ($line = $this->dbh->fetch_assoc($result)) {
+               while ($line = $dbh->fetch_assoc($result)) {
                        $feed_id = $line["id"];
 
                        if (time() - $tstart < ini_get("max_execution_time") * 0.7) {
@@ -559,6 +552,10 @@ class RPC extends Handler_Protected {
 
        }
 
+       function updaterandomfeed() {
+               RPC::updaterandomfeed_real($this->dbh);
+       }
+
        private function markArticlesById($ids, $cmode) {
 
                $tmp_ids = array();