migrate to getLineageIterator to save memory
This commit is contained in:
parent
cc87552a22
commit
2c75ab27e6
34 changed files with 794 additions and 187 deletions
|
|
@ -400,14 +400,21 @@ for generating an RSS and Atom feeds.
|
|||
|
||||
sub getRssFeedItems {
|
||||
my $self = shift;
|
||||
my $stories = $self->getLineageIterator(['descendants'],{
|
||||
my $storyIter = $self->getLineageIterator(['descendants'],{
|
||||
excludeClasses => ['WebGUI::Asset::Wobject::Folder'],
|
||||
orderByClause => 'creationDate desc, lineage',
|
||||
returnObjects => 1,
|
||||
limit => $self->get('itemsPerFeed'),
|
||||
});
|
||||
my $storyData = [];
|
||||
while (my $story = $stories->()) {
|
||||
while ( 1 ) {
|
||||
my $story;
|
||||
eval { $story = $storyIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $story;
|
||||
push @{ $storyData }, $story->getRssData;
|
||||
}
|
||||
return $storyData;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue