Skip to content

Commit

Permalink
fix(core): flow can be null, and we can know if it can be purged
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Aug 4, 2022
1 parent 96ac4cf commit 79653c5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,9 @@ public Execution addDynamicTaskRun(Execution execution, Flow flow, WorkerTaskRes
}

public boolean canBePurged(final Executor executor) {
return conditionService.isTerminatedWithListeners(executor.getFlow(), executor.getExecution())
return executor.getFlow() != null &&
// is terminated
conditionService.isTerminatedWithListeners(executor.getFlow(), executor.getExecution())
// we don't purge pause execution in order to be able to restart automatically in case of delay
&& executor.getExecution().getState().getCurrent() != State.Type.PAUSED
// we don't purge killed execution in order to have feedback about child running tasks
Expand Down

0 comments on commit 79653c5

Please sign in to comment.