Skip to content

Commit c1b5c0e

Browse files
committed
MAGETWO-63945: Add extension point to sales grid indexer
- Add constraints for sales_order_grid
1 parent edb406d commit c1b5c0e

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

app/code/Magento/Sales/Model/ResourceModel/Provider/UpdatedIdListProvider.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Sales\Model\ResourceModel\Provider;
77

88
use Magento\Framework\App\ResourceConnection;
9+
use Magento\Framework\DB\Adapter\AdapterInterface;
910

1011
/**
1112
* Provides latest updated entities ids list
@@ -17,6 +18,11 @@ class UpdatedIdListProvider implements IdListProviderInterface
1718
*/
1819
private $resourceConnection;
1920

21+
/**
22+
* @var AdapterInterface
23+
*/
24+
private $connection;
25+
2026
/**
2127
* IdListProvider constructor.
2228
* @param ResourceConnection $resourceConnection
@@ -58,10 +64,16 @@ private function getLastUpdatedAtValue($gridTableName)
5864
}
5965

6066
/**
61-
* @return \Magento\Framework\DB\Adapter\AdapterInterface
67+
* Returns connection.
68+
*
69+
* @return AdapterInterface
6270
*/
6371
private function getConnection()
6472
{
65-
return $this->resourceConnection->getConnection();
73+
if (!$this->connection) {
74+
$this->connection = $this->resourceConnection->getConnection('sales');
75+
}
76+
77+
return $this->connection;
6678
}
6779
}

dev/tests/integration/testsuite/Magento/Sales/Model/ResourceModel/GridTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ protected function setUp()
3232
/**
3333
* Tests asynchronous insertion of the new entity into order grid.
3434
*
35+
* @magentoDbIsolation enabled
36+
* @magentoAppIsolation enabled
3537
* @magentoDataFixture Magento/Sales/_files/order_async.php
3638
*/
3739
public function testRefreshByScheduleAsyncModeSuccess()

0 commit comments

Comments
 (0)