From 6823cc39448ece6577747b5a5d8ca7ca6891e96a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 23 Jan 2008 09:49:00 +0100 Subject: update daemon: use last_update_started --- update_daemon.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'update_daemon.php') diff --git a/update_daemon.php b/update_daemon.php index c3210945a..2303108a6 100644 --- a/update_daemon.php +++ b/update_daemon.php @@ -132,6 +132,12 @@ $update_limit_qpart = "AND ttrss_feeds.last_updated < DATE_SUB(NOW(), INTERVAL ".(DAEMON_SLEEP_INTERVAL*2)." SECOND)"; } + if (DB_TYPE == "pgsql") { + $updstart_thresh_qpart = "AND (ttrss_feeds.last_update_started IS NULL OR ttrss_feeds.last_update_started >= NOW() - INTERVAL '120 seconds')"; + } else { + $updstart_thresh_qpart = "AND (ttrss_feeds.last_update_started IS NULL OR ttrss_feeds.last_update_started >= DATE_SUB(NOW(), INTERVAL 120 SECOND))"; + } + $result = db_query($link, "SELECT feed_url,ttrss_feeds.id,owner_uid, SUBSTRING(last_updated,1,19) AS last_updated, update_interval @@ -139,6 +145,7 @@ ttrss_feeds,ttrss_users WHERE ttrss_users.id = owner_uid $login_thresh_qpart $update_limit_qpart + $updstart_thresh_qpart ORDER BY $random_qpart DESC LIMIT " . DAEMON_FEED_LIMIT); $user_prefs_cache = array(); -- cgit v1.2.3