Skip to content

Commit 731132c

Browse files
committed
MAGE-1122 Adjust profiling for exception based control flow
1 parent 1cd7f2c commit 731132c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Helper/Entity/ProductHelper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,6 @@ protected function clearFacetsQueryRules($indexName): void
13131313
*/
13141314
public function canProductBeReindexed($product, $storeId, $isChildProduct = false)
13151315
{
1316-
$this->logger->startProfiling(__METHOD__);
13171316
if ($product->isDeleted() === true) {
13181317
throw (new ProductDeletedException())
13191318
->withProduct($product)
@@ -1347,7 +1346,6 @@ public function canProductBeReindexed($product, $storeId, $isChildProduct = fals
13471346
->withStoreId($storeId);
13481347
}
13491348

1350-
$this->logger->stopProfiling(__METHOD__);
13511349
return true;
13521350
}
13531351

Service/Product/IndexBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,13 @@ protected function getProductsRecords($storeId, $collection, $potentiallyDeleted
327327
}
328328

329329
try {
330+
$this->logger->startProfiling("canProductBeReindexed");
330331
$this->productHelper->canProductBeReindexed($product, $storeId);
331332
} catch (ProductReindexingException $e) {
332333
$productsToRemove[$productId] = $productId;
333334
continue;
335+
} finally {
336+
$this->logger->stopProfiling("canProductBeReindexed");
334337
}
335338

336339
if (isset($salesData[$productId])) {

0 commit comments

Comments
 (0)