when the number of feeds is greater than DAEMON_UPDATE_LOGIN_LIMIT, newly added feeds are never updated.
The cause of this is that postgres by default treats NULL values as greater than everything and the feeds with NULL in last_updated are therefore always cut off by the limit statement.
This is easily fixed by adding 'NULLS FIRST' to the order query in postgres, changes to the mysql version are not needed.
I've added a proposed patch for this and would be willing to commit this as merge request, if you grant permissions to my gitlab account: RoXX
Code: Select all
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 56a16ec..380960b 100755
@@ -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
ttrss_feeds, ttrss_users, ttrss_user_prefs
@@ -144,7 +148,7 @@
AND ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL'
- ORDER BY last_updated $query_limit";
+ $query_order $query_limit";
// We search for feed needing update.
$result = db_query($query);