mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-30 02:37:58 +08:00
Merge branch 'master' into closure
This commit is contained in:
commit
15a392903b
@ -1,8 +1,17 @@
|
||||
# v1.1.28 - TBD
|
||||
|
||||
## Added
|
||||
|
||||
- [#1645](https://github.com/hyperf/hyperf/pull/1645) Added parameter injection support for closure route.
|
||||
|
||||
## Fixed
|
||||
|
||||
- [#1639](https://github.com/hyperf/hyperf/pull/1639) Fixed bug that the unhealthy node will be got from `consul`.
|
||||
|
||||
## Optimized
|
||||
|
||||
- [#1636](https://github.com/hyperf/hyperf/pull/1636) Optimized `co-phpunit` do not broken in coroutine environment, when cases failed.
|
||||
|
||||
# v1.1.27 - 2020-04-23
|
||||
|
||||
## Added
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
\Swoole\Coroutine\Run(function () {
|
||||
|
||||
$code = 0;
|
||||
\Swoole\Coroutine\Run(function () use (&$code) {
|
||||
if (version_compare('7.1.0', PHP_VERSION, '>')) {
|
||||
fwrite(
|
||||
STDERR,
|
||||
@ -51,8 +53,8 @@
|
||||
require PHPUNIT_COMPOSER_INSTALL;
|
||||
|
||||
$code = PHPUnit\TextUI\Command::main(false);
|
||||
|
||||
if ($code > 0) {
|
||||
exit($code);
|
||||
}
|
||||
});
|
||||
|
||||
swoole_event_wait();
|
||||
|
||||
exit($code);
|
||||
|
@ -230,14 +230,19 @@ abstract class AbstractServiceClient
|
||||
$services = $health->service($this->serviceName)->json();
|
||||
$nodes = [];
|
||||
foreach ($services as $node) {
|
||||
$passing = false;
|
||||
$passing = true;
|
||||
$service = $node['Service'] ?? [];
|
||||
$checks = $node['Checks'] ?? [];
|
||||
|
||||
if (isset($service['Meta']['Protocol']) && $this->protocol !== $service['Meta']['Protocol']) {
|
||||
// The node is invalid, if the protocol is not equal with the client's protocol.
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($checks as $check) {
|
||||
$status = $check['Status'] ?? false;
|
||||
if ($status === 'passing' && $this->protocol === $service['Meta']['Protocol']) {
|
||||
$passing = true;
|
||||
if ($status !== 'passing') {
|
||||
$passing = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
\Swoole\Coroutine::create(function () {
|
||||
|
||||
$code = 0;
|
||||
\Swoole\Coroutine::create(function () use (&$code) {
|
||||
if (version_compare('7.1.0', PHP_VERSION, '>')) {
|
||||
fwrite(
|
||||
STDERR,
|
||||
@ -58,9 +60,8 @@
|
||||
require PHPUNIT_COMPOSER_INSTALL;
|
||||
|
||||
$code = PHPUnit\TextUI\Command::main(false);
|
||||
if ($code > 0) {
|
||||
exit($code);
|
||||
}
|
||||
|
||||
swoole_event_exit();
|
||||
});
|
||||
|
||||
swoole_event_wait();
|
||||
|
||||
exit($code);
|
||||
|
Loading…
Reference in New Issue
Block a user