mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-27 14:48:08 -05:00
Limitation du nombre d'articles à charger en utilisant le chargement par parsing (pour éviter les débordements de mémoire)
This commit is contained in:
@@ -88,6 +88,7 @@ class Feed extends Model {
|
||||
private function loadEntries ($feed) {
|
||||
$entries = array ();
|
||||
|
||||
$i = 0;
|
||||
foreach ($feed->get_items () as $item) {
|
||||
$title = $item->get_title ();
|
||||
$author = $item->get_author ();
|
||||
@@ -100,6 +101,7 @@ class Feed extends Model {
|
||||
if ($path) {
|
||||
try {
|
||||
$content = get_content_by_parsing ($item->get_permalink (), $path);
|
||||
$i++;
|
||||
} catch (Exception $e) {
|
||||
$content = $item->get_content ();
|
||||
}
|
||||
@@ -118,6 +120,10 @@ class Feed extends Model {
|
||||
);
|
||||
|
||||
$entries[$entry->id ()] = $entry;
|
||||
|
||||
if ($i > 10) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->entries = $entries;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
return array (
|
||||
'posts_per_page' => 10,
|
||||
'default_view' => 'all',
|
||||
'display_posts' => 'no',
|
||||
'sort_order' => 'low_to_high',
|
||||
'old_entries' => 3,
|
||||
'mail_login' => '',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user