Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ private function processStoreQuotes(StoreInterface $store): void

foreach ($quotesToProcess as $quote) {
$count++;
$lastProcessedId = (int)$quote->getId();
try {
$this->quoteRepository->delete($quote);
$lastProcessedId = (int)$quote->getId();
} catch (Exception $e) {
$this->logger->error(sprintf(
'Unable to delete expired quote (ID: %s): %s',
$quote->getId(),
(string)$e
$e->getMessage()
));
}
if ($count % $this->batchSize === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ public function getExpiredPersistentQuotes(StoreInterface $store, int $lastId, i
Select::SQL_UNION_ALL
);

$quotes->getSelect()->where('main_table.entity_id IN (' . $selectQuoteIds . ')');
$quotes->getSelect()
->where('main_table.entity_id IN (' . $selectQuoteIds . ')')
->order('main_table.entity_id ' . Select::SQL_ASC)
->limit($batchSize);

return $quotes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ public function testGetExpiredPersistentQuotes(): void
->with($this->stringContains('main_table.entity_id IN ('))
->willReturnSelf();

$dbSelectMock3->method('where')
->with($this->stringContains('main_table.entity_id IN ('))
->willReturnSelf();
$dbSelectMock3->method('order')
->with('main_table.entity_id ' . Select::SQL_ASC)
->willReturnSelf();
$dbSelectMock3->method('limit')
->with(100)
->willReturnSelf();

$result = $this->model->getExpiredPersistentQuotes($storeMock, 0, 100);
$this->assertSame($quoteCollectionMock, $result);
}
Expand Down
Loading