Magento 2.4
I am importing around 80000 products from an external source in an external script (had to do it this way). They come from an API which uses tokes that are only valid for 2 hours. So every 2 hours the connection is closed and I have to restart the import and I have to check if a product already exists in order to skip it.
My approach right now is this:
$product = $objectManager->create('Magento\Catalog\Model\Product');
try {
$product = $productRepository->get($articelNumber);
} catch(Exception $e) {}
// If the product already exists, skip it
if($product->getId()) {
continue;
}
This takes a while. even for 10000 products and the more products I have the longer it takes to check them all. What would be way faster then this approach? Maybe direct SQL?
Thanks :-)