Skip to content

Commit

Permalink
Use a better method for checking if a server is connected
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlmoon committed Feb 24, 2023
1 parent 437c874 commit 38fec5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Net/Gearman/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ private function connect($server) {

if (isset($this->retryConn[$server])) {
unset($this->retryConn[$server]);
$this->status("Removing server from the retry list.", $server);
}

$this->status("Connected to $server", $server);
Expand Down Expand Up @@ -869,7 +870,7 @@ protected function status($message, $server = null)

if (!empty($server)) {
$failed_conns = isset($this->failedConn[$server]) ? $this->failedConn[$server] : 0;
$connected = isset($this->retryConn[$server]);
$connected = isset($this->conn[$server]) && $this->conn[$server]->isConnected();
} else {
$failed_conns = null;
$connected = null;
Expand Down

0 comments on commit 38fec5d

Please sign in to comment.