Skip to content

Commit

Permalink
fix: calling abort multiple times won't cause an exception
Browse files Browse the repository at this point in the history
Due to the exception being thrown when "something" aborts the dataflow, whether intentionally or by accident, the dataflow finish time was not being recorded, and other various cleanup activities potentially missed.

This should help to keep a nice log and resolve the issue with the finish time not being set.

Resolves #681
  • Loading branch information
keevan committed Jul 21, 2023
1 parent 81c3bfc commit 323102d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/local/execution/engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,11 @@ public function finalise() {
* @throws \Throwable
*/
public function abort(?\Throwable $reason = null) {
// If already aborted, do nothing.
if ($this->status === self::STATUS_ABORTED) {
return;
}

$message = '';
if (isset($reason)) {
$message .= $reason->getMessage();
Expand Down

0 comments on commit 323102d

Please sign in to comment.