summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-04-09 11:58:00 +0400
committerAndrew Dolgov <[email protected]>2012-04-09 11:58:00 +0400
commit6cb2269c034e2dbb5103d501adf3ab60329bb640 (patch)
tree70ac6460830c11e62841367086760b4a8b0a4fac
parentde44b9a61e4b507e1d60331e0ab11bb5f84a86e8 (diff)
disable internal magpie/simplepie cache for manual updates
-rw-r--r--include/rssfuncs.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index 1baa31d15..9ffe7a463 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -254,7 +254,7 @@
}
$result = db_query($link, "SELECT id,update_interval,auth_login,
- auth_pass,cache_images,update_method
+ auth_pass,cache_images,update_method,last_updated
FROM ttrss_feeds WHERE id = '$feed' AND $updstart_thresh_qpart");
} else {
@@ -348,7 +348,8 @@
$rss = fetch_twitter_rss($link, $fetch_url, $owner_uid);
} else if ($update_method == 1) {
- define('MAGPIE_CACHE_AGE', get_feed_update_interval($link, $feed) * 60);
+ // Ignore cache if manual update.
+ define('MAGPIE_CACHE_AGE', is_null($last_updated) ? -1 : get_feed_update_interval($link, $feed) * 60);
define('MAGPIE_CACHE_ON', !$no_cache);
define('MAGPIE_FETCH_TIME_OUT', 60);
define('MAGPIE_CACHE_DIR', CACHE_DIR . "/magpie");
@@ -376,8 +377,9 @@
$rss->enable_cache(!$no_cache);
if (!$no_cache) {
+ // Ignore cache if manual update.
$rss->set_cache_location($simplepie_cache_dir);
- $rss->set_cache_duration(get_feed_update_interval($link, $feed) * 60);
+ $rss->set_cache_duration(is_null($last_updated) ? -1 : get_feed_update_interval($link, $feed) * 60);
}
$rss->init();