Fixed the rpc client do not work, when jsonrpc server register the same service to consul with jsonrpc and jsonrpc-http protocol. (#1553)

Co-authored-by: daydaygo <1252409767@qq.com>
Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
Bi Zhiming 2020-04-23 11:54:55 +08:00 committed by GitHub
parent 0e287e7dbb
commit 760fff0c16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,7 @@
## Fixed
- [#1553](https://github.com/hyperf/hyperf/pull/1553) Fixed the rpc client do not work, when jsonrpc server register the same service to consul with jsonrpc and jsonrpc-http protocol.
- [#1607](https://github.com/hyperf/hyperf/pull/1607) Fixed bug that the return value of function `go` is not adaptive with `swoole`.
# v1.1.26 - 2020-04-16

View File

@ -230,14 +230,14 @@ abstract class AbstractServiceClient
$services = $health->service($this->serviceName)->json();
$nodes = [];
foreach ($services as $node) {
$passing = true;
$passing = false;
$service = $node['Service'] ?? [];
$checks = $node['Checks'] ?? [];
foreach ($checks as $check) {
$status = $check['Status'] ?? false;
if ($status !== 'passing') {
$passing = false;
if ($status === 'passing' && $this->protocol === $service['Meta']['Protocol']) {
$passing = true;
}
}