Skip to content

Commit

Permalink
Added retry on product models import
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGrimmChester committed Dec 26, 2023
1 parent b1ec88a commit da1b329
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Task/ProductModel/BatchProductModelTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Synolia\SyliusAkeneoPlugin\Task\ProductModel;

use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Result;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\ORMInvalidArgumentException;
use Doctrine\Persistence\ManagerRegistry;
Expand Down Expand Up @@ -64,7 +63,6 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte
$this->logger->notice(Messages::createOrUpdate($this->type));

$query = $this->getSelectStatement($payload);
/** @var Result $queryResult */
$queryResult = $query->executeQuery();

while ($results = $queryResult->fetchAllAssociative()) {
Expand Down Expand Up @@ -100,7 +98,7 @@ public function __invoke(PipelinePayloadInterface $payload): PipelinePayloadInte

$this->entityManager = $this->getNewEntityManager();
}
} while (false === $isSuccess && $this->retryCount !== $this->maxRetryCount);
} while (false === $isSuccess && $this->retryCount < $this->maxRetryCount);

unset($resource);
$this->removeEntry($payload, (int) $result['id']);
Expand Down

0 comments on commit da1b329

Please sign in to comment.