update daemon: use last_update_started

This commit is contained in:
Andrew Dolgov 2008-01-23 09:49:00 +01:00
parent 3c50da8334
commit 6823cc3944

View file

@ -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();