Skip to content

Commit 6a0c1b0

Browse files
authored
Merge pull request #8 from justbetter/feature/fix-retry-when-operations-are-deleted
Allow retry when some operations have been deleted
2 parents c2a6bf7 + 265664f commit 6a0c1b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Actions/RetryBulkRequest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function retry(BulkRequest $bulkRequest, bool $onlyFailed): ?BulkRequest
2626

2727
foreach ($bulkRequest->request as $index => $request) {
2828

29-
/** @var BulkOperation $operation */
30-
$operation = $operations->where('operation_id', '=', $index)->firstOrFail();
29+
/** @var ?BulkOperation $operation */
30+
$operation = $operations->where('operation_id', '=', $index)->first();
3131

32-
if ($onlyFailed && ! in_array($operation->status, OperationStatus::failedStatuses())) {
32+
if ($operation === null || ($onlyFailed && ! in_array($operation->status, OperationStatus::failedStatuses()))) {
3333
continue;
3434
}
3535

0 commit comments

Comments
 (0)