migrate to getLineageIterator to save memory
This commit is contained in:
parent
cc87552a22
commit
2c75ab27e6
34 changed files with 794 additions and 187 deletions
|
|
@ -107,14 +107,20 @@ sub execute {
|
|||
|
||||
# kill temporary assets
|
||||
my $tempspace = WebGUI::Asset->getTempspace($self->session);
|
||||
my $children = $tempspace->getLineage(["children"], {
|
||||
returnObjects => 1,
|
||||
my $childIter = $tempspace->getLineageIterator(["children"], {
|
||||
statesToInclude => [qw(trash clipboard published)],
|
||||
statusToInclude => [qw(pending archived approved)],
|
||||
});
|
||||
foreach my $asset (@{$children}) {
|
||||
if (time() - $asset->get("revisionDate") > $self->get("storageTimeout")) {
|
||||
unless ($asset->purge) {
|
||||
while ( 1 ) {
|
||||
my $child;
|
||||
eval { $child = $childIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $child;
|
||||
if (time() - $child->get("revisionDate") > $self->get("storageTimeout")) {
|
||||
unless ($child->purge) {
|
||||
return $self->ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue