Skip to content

Commit

Permalink
Reset deleteProducts array after processing batches
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjaap authored Apr 14, 2022
1 parent 2ba397d commit e24250e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Service/RegenerateProductUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ public function execute(?array $productIds = null, ?int $storeId = null, bool $v
$deleteProducts[] = $product->getId();
if (count($deleteProducts) >= self::BATCH_SIZE) {
$this->deleteUrls($deleteProducts, $store);
$deleteProducts = [];
}
}

if (count($deleteProducts)) {
$this->deleteUrls($deleteProducts, $store, true);
$deleteProducts = [];
}

$newUrls = [];
Expand Down

0 comments on commit e24250e

Please sign in to comment.