aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Models/Feed.php8
-rw-r--r--app/Models/FeedDAO.php2
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 ();