mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-05 21:28:15 +08:00
Format
This commit is contained in:
parent
bfd15a2ae0
commit
16c0934241
@ -12,7 +12,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Hyperf\RpcClient;
|
namespace Hyperf\RpcClient;
|
||||||
|
|
||||||
use Hyperf\Consul\Agent;
|
|
||||||
use Hyperf\Consul\Health;
|
use Hyperf\Consul\Health;
|
||||||
use Hyperf\Consul\HealthInterface;
|
use Hyperf\Consul\HealthInterface;
|
||||||
use Hyperf\Contract\ConfigInterface;
|
use Hyperf\Contract\ConfigInterface;
|
||||||
@ -203,7 +202,7 @@ abstract class AbstractServiceClient
|
|||||||
$passing = true;
|
$passing = true;
|
||||||
$service = $node['Service'] ?? [];
|
$service = $node['Service'] ?? [];
|
||||||
$checks = $node['Checks'] ?? [];
|
$checks = $node['Checks'] ?? [];
|
||||||
|
|
||||||
foreach ($checks as $check) {
|
foreach ($checks as $check) {
|
||||||
$status = $check['Status'] ?? false;
|
$status = $check['Status'] ?? false;
|
||||||
if ($status !== 'passing') {
|
if ($status !== 'passing') {
|
||||||
@ -213,7 +212,7 @@ abstract class AbstractServiceClient
|
|||||||
|
|
||||||
if ($passing) {
|
if ($passing) {
|
||||||
$address = $service['Address'] ?? '';
|
$address = $service['Address'] ?? '';
|
||||||
$port = (int)$service['Port'] ?? 0;
|
$port = (int) $service['Port'] ?? 0;
|
||||||
// @TODO Get and set the weight property.
|
// @TODO Get and set the weight property.
|
||||||
$address && $port && $nodes[] = new Node($address, $port);
|
$address && $port && $nodes[] = new Node($address, $port);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user