Make PurgeOldTrash respect the workflow activity TTL.
This commit is contained in:
parent
8d4a63b774
commit
29b0d490b9
1 changed files with 14 additions and 6 deletions
|
|
@ -75,13 +75,21 @@ See WebGUI::Workflow::Activity::execute() for details.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub execute {
|
sub execute {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $sth = $self->session->db->read("select assetId,className from asset where state='trash' and stateChanged < ?", [time() - $self->get("purgeAfter")]);
|
my $sth = $self->session->db->read( "select assetId,className from asset where state='trash' and stateChanged < ? order by stateChanged ASC",
|
||||||
while (my ($id, $class) = $sth->array) {
|
[ time() - $self->get("purgeAfter") ]
|
||||||
my $asset = WebGUI::Asset->new($self->session, $id,$class);
|
);
|
||||||
$asset->purge if (defined $asset);
|
my $expireTime = time() + $self->getTTL();
|
||||||
|
while ( my ( $id, $class ) = $sth->array ) {
|
||||||
|
my $asset = WebGUI::Asset->new( $self->session, $id, $class );
|
||||||
|
$asset->purge if ( defined $asset );
|
||||||
|
if (time() > $expireTime) {
|
||||||
|
$sth->finish;
|
||||||
|
return $self->WAITING(1);
|
||||||
}
|
}
|
||||||
return $self->COMPLETE;
|
}
|
||||||
|
$sth->finish;
|
||||||
|
return $self->COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue