]> git.wh0rd.org - tt-rss.git/blobdiff - include/rssfuncs.php
do not automatically call cleanup_tags() in housekeeping tasks
[tt-rss.git] / include / rssfuncs.php
index 115d9c9c2ce1cd4379e9b95461feaf5120f40e6e..f13ac36ddfedef48ca86e3bae8c3a159bec552c0 100755 (executable)
                $query_limit = "";
                if($limit) $query_limit = sprintf("LIMIT %d", $limit);
 
+               // Update the least recently updated feeds first
+               $query_order = "ORDER BY last_updated";
+               if (DB_TYPE == "pgsql") $query_order .= " NULLS FIRST";
+
                $query = "SELECT DISTINCT ttrss_feeds.feed_url, ttrss_feeds.last_updated
                        FROM
                                ttrss_feeds, ttrss_users, ttrss_user_prefs
                                AND ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL'
                                $login_thresh_qpart $update_limit_qpart
                                $updstart_thresh_qpart
-                               ORDER BY last_updated $query_limit";
+                               $query_order $query_limit";
 
                // We search for feed needing update.
                $result = db_query($query);
                                        $entry_stored_hash = db_fetch_result($result, 0, "content_hash");
                                        $article_labels = get_article_labels($base_entry_id, $owner_uid);
                                        $entry_language = db_fetch_result($result, 0, "lang");
+
+                                       $existing_tags = get_article_tags($base_entry_id, $owner_uid);
+                                       $entry_tags = array_unique(array_merge($entry_tags, $existing_tags));
+
                                } else {
                                        $base_entry_id = false;
                                        $entry_stored_hash = "";
 
                purge_orphans( true);
                cleanup_counters_cache($debug);
-               $rc = cleanup_tags( 14, 50000);
 
-               _debug("Cleaned $rc cached tags.");
+               //$rc = cleanup_tags( 14, 50000);
+               //_debug("Cleaned $rc cached tags.");
 
                PluginHost::getInstance()->run_hooks(PluginHost::HOOK_HOUSE_KEEPING, "hook_house_keeping", "");