summaryrefslogtreecommitdiff
path: root/update_daemon.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-11-20 03:49:23 +0100
committerAndrew Dolgov <[email protected]>2007-11-20 03:49:23 +0100
commit4a28f2bff572de12e15ed4fc0555a7088f2487df (patch)
tree5efad96bb09c6a1ebba6aa1cb84ef74d3c358cc3 /update_daemon.php
parent88b47be7c662cefa701e53dd8dbf49553eb64852 (diff)
limit number of feeds selected by update daemon by last update
Diffstat (limited to 'update_daemon.php')
-rw-r--r--update_daemon.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/update_daemon.php b/update_daemon.php
index 75229f667..e5d368a8d 100644
--- a/update_daemon.php
+++ b/update_daemon.php
@@ -126,13 +126,19 @@
$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();