summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-10-13 04:15:09 +0100
committerAndrew Dolgov <[email protected]>2005-10-13 04:15:09 +0100
commitd148926e2b96602707a4b012966e943e865d48d2 (patch)
treeb0609c6f509eecf1503d6bba41a9cff938180e52 /functions.php
parent1cae701741421b38ec9e7f982e2b22a7de9c7a41 (diff)
per-feed update intervals
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/functions.php b/functions.php
index 0c0fc047f..a2e29655b 100644
--- a/functions.php
+++ b/functions.php
@@ -24,12 +24,20 @@
db_query($link, "BEGIN");
- $result = db_query($link, "SELECT feed_url,id,last_updated FROM ttrss_feeds");
+ $result = db_query($link, "SELECT feed_url,id,
+ substring(last_updated,1,19) as last_updated,
+ update_interval FROM ttrss_feeds");
while ($line = db_fetch_assoc($result)) {
-// if (!$line["last_updated"] || time() - strtotime($line["last_updated"]) > 1800) {
+ $upd_intl = $line["update_interval"];
+
+ if (!$upd_intl) $upd_intl = MIN_UPDATE_INTERVAL;
+
+ if (!$line["last_updated"] ||
+ time() - strtotime($line["last_updated"]) > ($upd_intl * 60)) {
+
update_rss_feed($link, $line["feed_url"], $line["id"]);
-// }
+ }
}
purge_old_posts($link);