where('subject_type', Order::class) ->where('subject_id', $order->id) ->inFlight() ->get(['pipeline', 'current_step']); foreach ($runs as $run) { try { if ($this->registry->stillCovers($run->pipeline, $run->current_step, $pipeline)) { return true; } } catch (InvalidArgumentException) { // A pipeline that no longer exists (renamed in a deploy while a // run was in flight) covers nothing. The run will fail at its // next advance for the same reason; refusing to start the work // over it would lose the work as well. continue; } } return false; } }