diff options
| author | 2014-02-11 22:10:55 +0100 | |
|---|---|---|
| committer | 2014-02-11 22:10:55 +0100 | |
| commit | 06abbd02c2d10934155b2464f73d8ecdb2a68de1 (patch) | |
| tree | 03494c385ffd6604332dbd65cb8a0d2893607bf8 /app/Models/FeedDAO.php | |
| parent | 0cabd1f50dd7d1cf0941a50139e6fbeed6825b4d (diff) | |
Rafraîchit uniquement les flux qui n'ont pas déjà été rafraîchis récemment
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/351
Diffstat (limited to 'app/Models/FeedDAO.php')
| -rw-r--r-- | app/Models/FeedDAO.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index a2ce0e46f..7ebe68d2b 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -198,8 +198,11 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC)); } - public function listFeedsOrderUpdate () { - $sql = 'SELECT id, name, url, lastUpdate, pathEntries, httpAuth, keep_history FROM `' . $this->prefix . 'feed` ORDER BY lastUpdate'; + public function listFeedsOrderUpdate ($cacheDuration = 1500) { + $sql = 'SELECT id, name, url, lastUpdate, pathEntries, httpAuth, keep_history ' + . 'FROM `' . $this->prefix . 'feed` ' + . 'WHERE lastUpdate < ' . (time() - intval($cacheDuration)) + . ' ORDER BY lastUpdate'; $stm = $this->bd->prepare ($sql); $stm->execute (); |
