summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-01-23 10:19:36 +0100
committerAndrew Dolgov <[email protected]>2008-01-23 10:19:36 +0100
commit02008cb19ac99727889cca05c7eddfbeef30d684 (patch)
treeb1ff053ad8f846ea4171460edf0ba5220c2cb2e2 /functions.php
parentd4761137527576a249964eabaee66d36e62eb74f (diff)
add multiprocess update daemon
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/functions.php b/functions.php
index 919cd926c..9bd98795b 100644
--- a/functions.php
+++ b/functions.php
@@ -468,12 +468,19 @@
_debug("update_rss_feed: start");
}
- $result = db_query($link, "SELECT id,update_interval,auth_login,auth_pass,cache_images
- FROM ttrss_feeds WHERE id = '$feed'");
+ if (DB_TYPE == "pgsql") {
+ $updstart_thresh_qpart = "(ttrss_feeds.last_update_started IS NULL OR ttrss_feeds.last_update_started >= NOW() - INTERVAL '120 seconds')";
+ } else {
+ $updstart_thresh_qpart = "(ttrss_feeds.last_update_started IS NULL OR ttrss_feeds.last_update_started >= DATE_SUB(NOW(), INTERVAL 120 SECOND))";
+ }
+
+ $result = db_query($link, "SELECT id,update_interval,auth_login,
+ auth_pass,cache_images
+ FROM ttrss_feeds WHERE id = '$feed' AND $updstart_thresh_qpart");
if (db_num_rows($result) == 0) {
if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) {
- _debug("update_rss_feed: feed $feed [$feed_url] NOT FOUND");
+ _debug("update_rss_feed: feed $feed [$feed_url] NOT FOUND/SKIPPED");
}
return;
}