Skip to content

Commit c0a77fd

Browse files
committed
ACPT-99: Import API Parallelization
1 parent 41e5576 commit c0a77fd

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

app/code/Magento/ImportExport/Model/Import/AbstractEntity.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,11 @@ protected function _saveValidatedBunches()
420420
$startNewBunch = false;
421421

422422
$source->rewind();
423-
$this->_dataSourceModel->cleanProcessedBunches();
423+
if ($this->ids) {
424+
$this->_dataSourceModel->cleanProcessedBunches();
425+
} else {
426+
$this->_dataSourceModel->cleanBunches();
427+
}
424428
$mainAttributeCode = $this->getMasterAttributeCode();
425429

426430
while ($source->valid() || count($bunchRows) || isset($entityGroup)) {

app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,11 @@ protected function _saveValidatedBunches()
394394
$skuSet = [];
395395

396396
$source->rewind();
397-
$this->_dataSourceModel->cleanProcessedBunches();
397+
if ($this->ids) {
398+
$this->_dataSourceModel->cleanProcessedBunches();
399+
} else {
400+
$this->_dataSourceModel->cleanBunches();
401+
}
398402

399403
while ($source->valid() || $bunchRows) {
400404
if ($startNewBunch || !$source->valid()) {

app/code/Magento/ImportExport/Model/ResourceModel/Import/Data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ public function cleanBunches()
116116
return $this->getConnection()->delete($this->getMainTable());
117117
}
118118

119-
120119
/**
121120
* Clean all bunches from table.
122121
*
@@ -141,10 +140,11 @@ public function cleanProcessedBunches()
141140
*/
142141
public function markProcessedBunches(array $ids): void
143142
{
143+
$where = $ids ? ['id IN (?)' => $ids] : '';
144144
$this->getConnection()->update(
145145
$this->getMainTable(),
146146
['is_processed' => '1'],
147-
['id IN (?)' => $ids]
147+
$where
148148
);
149149
}
150150

0 commit comments

Comments
 (0)