Skip to content

Commit

Permalink
Merge pull request #80 from wkaminsk/bugfix/optymalise-holded-cron-pr…
Browse files Browse the repository at this point in the history
…ocess

TIS-695 Added optimalisation for cron process
  • Loading branch information
mooseriskified authored Jan 21, 2024
2 parents 8e7ddbf + 1c6fb55 commit 21359f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions Model/Cron/ReleaseOnHoldOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,18 @@ public function execute()
$this->cache->save(1, self::CACHE_KEY, [], 15);

$orderStatusFilter = $this->filterBuilder
->setField('state')
->setValue('holded')
->setField('status')
->setValue('riskified_holded')
->setConditionType('eq')
->create();

$searchCriteria = $this->searchCriteria->addFilter($orderStatusFilter)->create();
$searchCriteria = $this->searchCriteria
->addFilter($orderStatusFilter)
->addSortOrder('entity_id', 'DESC')
->setPageSize(10)
->setCurrentPage(1)
->create();

$orderList = $this->orderRepository->getList($searchCriteria);

if ($orderList->getTotalCount() == 0) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "riskified/magento2new",
"type": "magento2-module",
"description": "Riskified decider module for Magento 2",
"version": "1.12.18",
"version": "1.12.19",
"require": {
"php": ">=7.4",
"magento/framework": ">=100.1.0",
Expand Down

0 comments on commit 21359f5

Please sign in to comment.