summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-12-31 16:58:08 +0300
committerAndrew Dolgov <[email protected]>2015-12-31 16:58:08 +0300
commit7f4fff96b1605dbadc2ac069665a21230c64a44b (patch)
tree33258abc9a654d868faa8789bbc48fe97c25b6a4
parent85d067e837ef743e67d2fa84e254c08b56d090a4 (diff)
parent98070db009ea2438a00cc652877d45cca86ae462 (diff)
Merge branch 'update-new-feeds-first-postgres' into 'master'
Update new feeds first in postgres As disscussed in the forum: https://tt-rss.org/forum/viewtopic.php?f=10&t=3644&p=21594#p21594, this fixes a bug where newly added feeds wouldn't be updated if the number of total feeds exceeded the DAEMON_FEED_LIMIT. See merge request !22
-rwxr-xr-xinclude/rssfuncs.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 56a16ec6c..380960bd8 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);