We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The process in EntityQueueManagement.php stops with limit of batch size without iteration through the queue.
This code loads queue fully with setting current page for collection
/** * {@inheritdoc} * @return $this */ protected function getQueueCollection($curPage = 1) { $entityQueueCollection = $this->entityQueueFactory->create()->getCollection(); $entityQueueCollection->addFilter('processed', ['eq' => 0]); return $entityQueueCollection->setPageSize($this->getBatchSize())->setCurPage($curPage); } /** * {@inheritdoc} * @return bool * @throws \Magento\Framework\Exception\LocalizedException */ public function processQueue() { $allLoaded = FALSE; $curPage = 1; $i = 1; while(!$allLoaded) { $collection = $this->getQueueCollection($curPage); if($collection->getSize() >= $i) { try { foreach ($collection as $queueItem) { $eventType = $queueItem->getEventType(); $processor = null; if ($eventType) { $processor = $this->getEntityProcessor($eventType); } $entityData = $this->getEntityData($queueItem); $result = $processor->process($entityData); var_dump($result); if ($result) { $queueItem->setProcessed(1); $queueItem->setProcessedAt(new \DateTime('now')); $this->entityQueueRepository->save($queueItem); } $i++; } } catch (\Exception $e) { throw new \Magento\Framework\Exception\LocalizedException(__('Could not process Queue item')); return false; } $curPage++; } else { $allLoaded = TRUE; } } return true; }
The text was updated successfully, but these errors were encountered:
- Fix issue QueueCollection does not iterate (#7)
5cdc052
Hi @clicktrend,
The suggested solution has been merged into master.
Kind Regards,
Jaimy Casteleijn
Sorry, something went wrong.
No branches or pull requests
The process in EntityQueueManagement.php stops with limit of batch size without iteration through the queue.
This code loads queue fully with setting current page for collection
The text was updated successfully, but these errors were encountered: