Update TrashExpiredEvents to wg8.
This commit is contained in:
parent
ed58eba697
commit
e75989090a
1 changed files with 10 additions and 10 deletions
|
|
@ -75,16 +75,16 @@ 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 from EventsCalendar_event where eventEndDate < ?", [time()-$self->get("trashAfter")]);
|
my $sth = $self->session->db->read("select assetId from EventsCalendar_event where eventEndDate < ?", [time()-$self->get("trashAfter")]);
|
||||||
while (my ($id) = $sth->array) {
|
while (my ($id) = $sth->array) {
|
||||||
my $asset = WebGUI::Asset::Event->new($self->session, $id);
|
my $asset = eval { WebGUI::Asset::Event->newById($self->session, $id); };
|
||||||
if (defined $asset && $asset->get("eventEndDate") < time()-$self->get("trashAfter")) {
|
if (! Exception::Class->caught() && $asset->get("eventEndDate") < time()-$self->get("trashAfter")) {
|
||||||
$asset->trash;
|
$asset->trash;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$sth->finish;
|
}
|
||||||
return $self->COMPLETE;
|
$sth->finish;
|
||||||
|
return $self->COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue