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
|
||||
|
||||
sub execute {
|
||||
my $self = shift;
|
||||
my $sth = $self->session->db->read("select assetId from EventsCalendar_event where eventEndDate < ?", [time()-$self->get("trashAfter")]);
|
||||
while (my ($id) = $sth->array) {
|
||||
my $asset = WebGUI::Asset::Event->new($self->session, $id);
|
||||
if (defined $asset && $asset->get("eventEndDate") < time()-$self->get("trashAfter")) {
|
||||
$asset->trash;
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
return $self->COMPLETE;
|
||||
my $self = shift;
|
||||
my $sth = $self->session->db->read("select assetId from EventsCalendar_event where eventEndDate < ?", [time()-$self->get("trashAfter")]);
|
||||
while (my ($id) = $sth->array) {
|
||||
my $asset = eval { WebGUI::Asset::Event->newById($self->session, $id); };
|
||||
if (! Exception::Class->caught() && $asset->get("eventEndDate") < time()-$self->get("trashAfter")) {
|
||||
$asset->trash;
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
return $self->COMPLETE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue