aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-02-01 20:13:42 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-02-01 20:13:42 +0100
commit02d1dac0bb07884b79ddea20980bfcf21131f2d7 (patch)
tree1c004e5bbaf9cab501076547596f007906c46be0 /app/Models/Feed.php
parenta76e5bd1c65354dbdc9793179369ef0903d03762 (diff)
Rafraîchissement des flux en cache compatible multi-utilisateurs
Compatibilité multi-utilisateurs pour la mise à jour rapide des flux avec cache Correction de https://github.com/marienfressinaud/FreshRSS/commit/cf8ee6bd48221e73b515922e75945e9aa763f907#commitcomment-5247478 Contribue à https://github.com/marienfressinaud/FreshRSS/issues/351#issuecomment-31755012
Diffstat (limited to 'app/Models/Feed.php')
-rw-r--r--app/Models/Feed.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 662476b7e..366c04c67 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -193,9 +193,9 @@ class FreshRSS_Feed extends Minz_Model {
}
$feed = customSimplePie();
$feed->set_feed_url ($url);
- $initResult = $feed->init ();
+ $mtime = $feed->init();
- if ((!$initResult) || $feed->error()) {
+ if ((!$mtime) || $feed->error()) {
throw new FreshRSS_Feed_Exception ($feed->error() . ' [' . $url . ']');
}
@@ -217,9 +217,11 @@ class FreshRSS_Feed extends Minz_Model {
$this->_description(html_only_entity_decode($feed->get_description()));
}
- if (($initResult == SIMPLEPIE_INIT_SUCCESS) || $loadDetails) {
+ if (($mtime === true) || ($mtime > $this->lastUpdate)) {
+ syslog(LOG_DEBUG, 'FreshRSS no cache ' . $mtime . ' > ' . $this->lastUpdate);
$this->loadEntries($feed); // et on charge les articles du flux
} else {
+ syslog(LOG_DEBUG, 'FreshRSS use cache for ' . $subscribe_url);
$this->entries = array();
}
}