A free, self-hostable news aggregator…
Configurable amount of feeds that gets refreshed.
Alexander Steinhöfer0904f159b3b2
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.phpindex 0aed9b0a1..862bb10fb 100755--- a/app/Controllers/feedController.php+++ b/app/Controllers/feedController.php@@ -243,7 +243,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {}}- public static function actualizeFeed($feed_id, $feed_url, $force, $simplePiePush = null, $isNewFeed = false, $noCommit = false) {+ public static function actualizeFeed($feed_id, $feed_url, $force, $simplePiePush = null, $isNewFeed = false, $noCommit = false, $maxFeeds = 10) {@set_time_limit(300);$feedDAO = FreshRSS_Factory::createFeedDao();@@ -262,6 +262,11 @@ class FreshRSS_feed_Controller extends Minz_ActionController {$feeds = $feedDAO->listFeedsOrderUpdate(-1);}+ // Set maxFeeds to a minimum of 10+ if (!is_int($maxFeeds) || $maxFeeds < 10) {+ $maxFeeds = 10;+ }+// Calculate date of oldest entries we accept in DB.$nb_month_old = max(FreshRSS_Context::$user_conf->old_entries, 1);$date_min = time() - (3600 * 24 * 30 * $nb_month_old);@@ -459,9 +464,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController {$updated_feeds++;unset($feed);- // No more than 10 feeds unless $force is true to avoid overloading+ // No more than $maxFeeds feeds unless $force is true to avoid overloading// the server.- if ($updated_feeds >= 10 && !$force) {+ if ($updated_feeds >= $maxFeeds && !$force) {break;}}@@ -497,6 +502,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {$id = Minz_Request::param('id');$url = Minz_Request::param('url');$force = Minz_Request::param('force');+ $maxFeeds = (int)Minz_Request::param('maxFeeds');$noCommit = Minz_Request::fetchPOST('noCommit', 0) == 1;if ($id == -1 && !$noCommit) { //Special request only to commit & refresh DB cache@@ -511,7 +517,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {$databaseDAO = FreshRSS_Factory::createDatabaseDAO();$databaseDAO->minorDbMaintenance();} else {- list($updated_feeds, $feed, $nb_new_articles) = self::actualizeFeed($id, $url, $force, null, false, $noCommit);+ list($updated_feeds, $feed, $nb_new_articles) = self::actualizeFeed($id, $url, $force, null, false, $noCommit, $maxFeeds);}if (Minz_Request::param('ajax')) {