]> git.wh0rd.org Git - tt-rss.git/commitdiff
limit number of feeds selected by update daemon by last update
authorAndrew Dolgov <fox@bah.spb.su>
Tue, 20 Nov 2007 02:49:23 +0000 (03:49 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Tue, 20 Nov 2007 02:49:23 +0000 (03:49 +0100)
update_daemon.php

index 75229f667f3354de090671a85432fc0dca84f2fd..e5d368a8d3b2141c1a606784e62938b53a981a44 100644 (file)
                        $login_thresh_qpart = "";
                }
 
+               if (DB_TYPE == "pgsql") {
+                       $update_limit_qpart = "AND ttrss_feeds.last_updated < NOW() - INTERVAL '".(DAEMON_SLEEP_INTERVAL*2)." seconds'";
+               } else {
+                       $update_limit_qpart = "AND ttrss_feeds.last_updated < DATE_SUB(NOW(), INTERVAL ".(DAEMON_SLEEP_INTERVAL*2)." SECOND)";
+               }
+
                $result = db_query($link, "SELECT feed_url,ttrss_feeds.id,owner_uid,
                                SUBSTRING(last_updated,1,19) AS last_updated,
                                update_interval 
                        FROM 
                                ttrss_feeds,ttrss_users 
                        WHERE 
-                               ttrss_users.id = owner_uid $login_thresh_qpart 
+                               ttrss_users.id = owner_uid $login_thresh_qpart $update_limit_qpart 
                        ORDER BY $random_qpart DESC LIMIT " . DAEMON_FEED_LIMIT);
 
                $user_prefs_cache = array();