Skip to content

Commit c5e76d4

Browse files
committed
MAGETWO-80789: [Indexer] Search Indexer is scoped & multi-threaded
1 parent 6b02b96 commit c5e76d4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/code/Magento/Indexer/Model/ProcessManager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ private function multiThreadsExecute($userFunctions)
8787
$this->startChildProcess($userFunction);
8888
}
8989
}
90-
while(pcntl_waitpid(0, $status) != -1);
90+
while (pcntl_waitpid(0, $status) != -1) {
91+
//Waiting for the completion of child processes
92+
}
9193

9294
if ($this->failInChildProcess) {
9395
throw new \RuntimeException('Fail in child process');
9496
}
95-
9697
}
9798

9899
/**

lib/internal/Magento/Framework/App/ResourceConnection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ public function getConnection($resourceName = self::DEFAULT_CONNECTION)
104104
public function closeConnection($resourceName = self::DEFAULT_CONNECTION)
105105
{
106106
if ($resourceName === null) {
107-
foreach ($this->connections as $processConnectionName => $value) {
108-
if ($this->connections[$processConnectionName] instanceof AdapterInterface) {
109-
$this->connections[$processConnectionName]->closeConnection();
107+
foreach ($this->connections as $processConnection) {
108+
if ($processConnection instanceof AdapterInterface) {
109+
$processConnection->closeConnection();
110110
}
111111
}
112112
$this->connections = [];

0 commit comments

Comments
 (0)