Stop realtime run on deleted wf instances
This commit is contained in:
parent
b2924bdb7b
commit
890a94d3d5
2 changed files with 7 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
7.9.13
|
||||
- fixed #11783: Instances deleted during realtime run
|
||||
|
||||
7.9.12
|
||||
- webgui.org homepage gives 404 (#11778)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,10 @@ sub delete {
|
|||
$self->session->db->write("delete from WorkflowInstanceScratch where instanceId=?",[$self->getId]);
|
||||
$self->session->db->deleteRow("WorkflowInstance","instanceId",$self->getId);
|
||||
WebGUI::Workflow::Spectre->new($self->session)->notify("workflow/deleteInstance",$self->getId) unless ($skipNotify);
|
||||
undef $self;
|
||||
|
||||
# We will need to remember that we were deleted if we get realtime-run
|
||||
# during start().
|
||||
$self->{deleted} = 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -645,7 +648,8 @@ sub start {
|
|||
my $start = time();
|
||||
my $status = "complete";
|
||||
$log->info('Trying to execute workflow instance '.$self->getId.' in realtime.');
|
||||
while ($status eq "complete" && ($start > time() -10)) { # how much can we run in 10 seconds
|
||||
# If we got deleted in the middle, we need to stop. This is a hack.
|
||||
while (!$self->{deleted} && $status eq "complete" && ($start > time() -10)) { # how much can we run in 10 seconds
|
||||
$status = $self->run;
|
||||
$log->info('Completed activity for workflow instance '.$self->getId.' in realtime with return status of '.$status.'.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue