summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-02-08 04:45:07 +0100
committerAndrew Dolgov <[email protected]>2008-02-08 04:45:07 +0100
commit51b8c957ecce8f659f622950e0977734a6ac7365 (patch)
tree3212f56254d3e0d5f859d021b88811df1d4a42e3 /functions.php
parenta0c6eafbbc852a231cf6cc2673ba13c68d71d5b2 (diff)
select feeds to update randomly
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/functions.php b/functions.php
index 0b4a32a44..6fd61e4bd 100644
--- a/functions.php
+++ b/functions.php
@@ -5267,6 +5267,8 @@
$query_limit = "";
if($limit) $query_limit = sprintf("LIMIT %d", $limit);
+ $random_qpart = sql_random_function();
+
// We search for feed needing update.
$result = db_query($link, "SELECT ttrss_feeds.feed_url,ttrss_feeds.id, ttrss_feeds.owner_uid,
SUBSTRING(ttrss_feeds.last_updated,1,19) AS last_updated,
@@ -5277,14 +5279,17 @@
ttrss_feeds.owner_uid = ttrss_users.id
AND ttrss_users.id = ttrss_user_prefs.owner_uid
AND ttrss_user_prefs.pref_name = 'DEFAULT_UPDATE_INTERVAL'
+ AND ttrss_feeds.last_updated IS NULL
$login_thresh_qpart $update_limit_qpart
- $updstart_thresh_qpart
- ORDER BY ttrss_feeds.last_updated ASC $query_limit");
+ $updstart_thresh_qpart
+ ORDER BY $random_qpart $query_limit");
$user_prefs_cache = array();
if($debug) _debug(sprintf("Scheduled %d feeds to update...\n", db_num_rows($result)));
+ return;
+
// Here is a little cache magic in order to minimize risk of double feed updates.
$feeds_to_update = array();
while ($line = db_fetch_assoc($result)) {