diff options
author | Andrew Dolgov <[email protected]> | 2005-10-13 04:15:09 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-10-13 04:15:09 +0100 |
commit | d148926e2b96602707a4b012966e943e865d48d2 (patch) | |
tree | b0609c6f509eecf1503d6bba41a9cff938180e52 /functions.php | |
parent | 1cae701741421b38ec9e7f982e2b22a7de9c7a41 (diff) |
per-feed update intervals
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 14 |
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); |