Rafraîchit uniquement les flux qui n'ont pas déjà été rafraîchis récemment

Contribue à https://github.com/marienfressinaud/FreshRSS/issues/351
pull/426/head
Alexandre Alapetite 11 years ago
parent 0cabd1f50d
commit 06abbd02c2
  1. 2
      app/Controllers/javascriptController.php
  2. 7
      app/Models/FeedDAO.php

@ -8,7 +8,7 @@ class FreshRSS_javascript_Controller extends Minz_ActionController {
public function actualizeAction () {
header('Content-Type: text/javascript; charset=UTF-8');
$feedDAO = new FreshRSS_FeedDAO ();
$this->view->feeds = $feedDAO->listFeeds ();
$this->view->feeds = $feedDAO->listFeedsOrderUpdate();
}
public function nbUnreadsPerFeedAction() {

@ -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 ();

Loading…
Cancel
Save