Skip to content

Commit

Permalink
Remove PID check for getConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
gilberg-vrn committed Mar 18, 2022
1 parent d248a96 commit b140647
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/ElasticSearch/Transport/HTTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
class HTTP
extends Base
{
/**
* @var int
*/
protected $pid;

/** @var forkManager */
protected $forkManager;
Expand All @@ -46,8 +42,6 @@ public function __construct(string $host = 'localhost', int $port = 9200, int $t
if (null !== $timeout) {
$this->setTimeout($timeout);
}
$this->ch = curl_init();
$this->pid = getmypid();
}

/**
Expand Down Expand Up @@ -328,18 +322,13 @@ public function getTimeout(): int
private function getConnection()
{
if ($this->forkManager) {
if (!$this->forkManager->isContextAlive()) {
if ($this->ch === null || !$this->forkManager->isContextAlive()) {
$this->ch = curl_init();
}

return $this->ch;
}

if ($this->pid !== getmypid()) {
$this->ch = curl_init();
$this->pid = getmypid();
}

return $this->ch;
return curl_init();
}
}

0 comments on commit b140647

Please sign in to comment.