From 98070db009ea2438a00cc652877d45cca86ae462 Mon Sep 17 00:00:00 2001 From: Thomas Kramer Date: Thu, 31 Dec 2015 12:54:52 +0100 Subject: [PATCH] Update new feeds first in postgres --- include/rssfuncs.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 56a16ec6..380960bd 100755 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -134,6 +134,10 @@ $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 @@ -144,7 +148,7 @@ 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); -- 2.39.5