]> git.wh0rd.org - tt-rss.git/blobdiff - update_daemon.php
update_daemon work, remove unneeded indexes, query optimizations
[tt-rss.git] / update_daemon.php
index cf51bdd3abfe090ff28a76e438bffd7bc458fa37..8c36fda6831c755de271d99eb29e40c6af81443b 100644 (file)
@@ -55,8 +55,8 @@
        while (true) {
 
                if (time() - $last_purge > PURGE_INTERVAL) {
-                       print "Purging old posts...\n";
-                       global_purge_old_posts($link, true);
+                       print "Purging old posts (random 30 feeds)...\n";
+                       global_purge_old_posts($link, true, 30);
                        $last_purge = time();
                }
 
        
                // Process all other feeds using last_updated and interval parameters
 
+               $random_qpart = sql_random_function();
+
                $result = db_query($link, "SELECT feed_url,id,owner_uid,
                        SUBSTRING(last_updated,1,19) AS last_updated,
-                       update_interval FROM ttrss_feeds ORDER BY last_updated DESC");
+                       update_interval FROM ttrss_feeds ORDER BY $random_qpart DESC");
 
                $user_prefs_cache = array();