Export a method from Workflow::Activity for timeouts and use it in all current Workflows
This commit is contained in:
parent
85ecaa9a09
commit
726bd5ee05
12 changed files with 36 additions and 12 deletions
|
|
@ -70,6 +70,7 @@ See WebGUI::Workflow::Activity::execute() for details.
|
|||
sub execute {
|
||||
my $self = shift;
|
||||
my $start = time();
|
||||
my $ttl = $self->getTTL;
|
||||
foreach my $id (@{WebGUI::Mail::Send->getMessageIdsInQueue($self->session)}) {
|
||||
my $message = WebGUI::Mail::Send->retrieve($self->session, $id);
|
||||
if (defined $message) {
|
||||
|
|
@ -79,7 +80,7 @@ sub execute {
|
|||
}
|
||||
}
|
||||
# just in case there are a lot of messages, we should release after a minutes worth of sending
|
||||
last if (time() > $start + 60);
|
||||
last if (time() > $start + $ttl);
|
||||
}
|
||||
return $self->COMPLETE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue