- # We don't need transaction stuff from rt-crontool here
- action($ticket, 'EscalatePriority', "CurrentTime:$time");
+ my @a = task_actions($ticket);
+ push @actions, @a;
+ push @active_tickets, $ticket if @a; # avoid garbage collection
+ }
+ }
+
+ # and then commit them all
+ foreach (grep {$_} @actions) {
+ my ($val, $msg) = $_->Commit;
+ if ( $DEBUG ) {
+ if ($val) {
+ warn "Action committed: ".ref($_)." #".$_->TicketObj->Id."\n";
+ }
+ else {
+ warn "Action returned $msg: #".$_->TicketObj->Id."\n";
+ }