]> git.wh0rd.org Git - tt-rss.git/commitdiff
Update new feeds first in postgres
authorThomas Kramer <kramer.tom@gmail.com>
Thu, 31 Dec 2015 11:54:52 +0000 (12:54 +0100)
committerThomas Kramer <kramer.tom@gmail.com>
Thu, 31 Dec 2015 11:54:52 +0000 (12:54 +0100)
include/rssfuncs.php

index 56a16ec6c2f9db2a8e237bc0ea10f91ac3267fa1..380960bd83383dca56f85cd7bbbbfd8e683051a9 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);