mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-05 05:07:58 +08:00
Update AbstractServiceClient.php
This commit is contained in:
parent
04160bb07f
commit
c3bad4c68d
@ -203,9 +203,10 @@ abstract class AbstractServiceClient
|
||||
$passing = true;
|
||||
$service = $node['Service'] ?? [];
|
||||
$checks = $node['Checks'] ?? [];
|
||||
|
||||
foreach ($checks as $check) {
|
||||
$status = $check['Status'] ?? false;
|
||||
if ($status != 'passing') {
|
||||
if ($status !== 'passing') {
|
||||
$passing = false;
|
||||
}
|
||||
}
|
||||
@ -213,7 +214,7 @@ abstract class AbstractServiceClient
|
||||
if ($passing) {
|
||||
$address = $service['Address'] ?? '';
|
||||
$port = (int)$service['Port'] ?? 0;
|
||||
$nodes[] = new Node($address, $port);
|
||||
$address && $port && $nodes[] = new Node($address, $port);
|
||||
}
|
||||
}
|
||||
return $nodes;
|
||||
|
Loading…
Reference in New Issue
Block a user