Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ps_facetedsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,11 @@ private function indexPrices($cursor = 0, $full = false, $ajax = false, $smart =
$time_elapsed = microtime(true) - $startTime;
$indexedProducts += $length;
} while (
$cursor < $nbProducts
// $cursor is the last indexed id_product (returned by indexPricesUnbreakable()), not a
// counter, so comparing it to the product count is wrong: with non-sequential ids (gaps
// from deleted/imported products) it stops batching as soon as an id exceeds $nbProducts.
// Track how many products were actually indexed instead.
$indexedProducts < $nbProducts
&& (Tools::getMemoryLimit() == -1 || Tools::getMemoryLimit() > memory_get_peak_usage())
&& $time_elapsed < $maxExecutiontime
);
Expand Down
Loading