diff options
author | Andrew Dolgov <[email protected]> | 2008-01-23 09:49:00 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2008-01-23 09:49:00 +0100 |
commit | 6823cc39448ece6577747b5a5d8ca7ca6891e96a (patch) | |
tree | 53d9b82affe43a221b6f6ac490a2bdd189499eda /update_daemon.php | |
parent | 3c50da8334f5c7d09c531b14d14d26d7309ddeb0 (diff) |
update daemon: use last_update_started
Diffstat (limited to 'update_daemon.php')
-rw-r--r-- | update_daemon.php | 7 |
1 files changed, 7 insertions, 0 deletions
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(); |