diff options
| author | 2014-02-01 20:13:42 +0100 | |
|---|---|---|
| committer | 2014-02-01 20:13:42 +0100 | |
| commit | 02d1dac0bb07884b79ddea20980bfcf21131f2d7 (patch) | |
| tree | 1c004e5bbaf9cab501076547596f007906c46be0 /app/Models | |
| parent | a76e5bd1c65354dbdc9793179369ef0903d03762 (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')
| -rw-r--r-- | app/Models/Feed.php | 8 | ||||
| -rw-r--r-- | app/Models/FeedDAO.php | 2 |
2 files changed, 6 insertions, 4 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(); } } diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index a17ff0718..a2ce0e46f 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -199,7 +199,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { } public function listFeedsOrderUpdate () { - $sql = 'SELECT id, name, url, pathEntries, httpAuth, keep_history FROM `' . $this->prefix . 'feed` ORDER BY lastUpdate'; + $sql = 'SELECT id, name, url, lastUpdate, pathEntries, httpAuth, keep_history FROM `' . $this->prefix . 'feed` ORDER BY lastUpdate'; $stm = $this->bd->prepare ($sql); $stm->execute (); |
