mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Fixed bug that heartbeat failed when using nacos without default group. (#3873)
* fixed 修复nacos原生用法心跳异常 * fixed 修复ephemeral 是否临时实例设置不生效问题 Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
parent
91aae7df4f
commit
2132ee5ebe
@ -2,7 +2,7 @@
|
||||
|
||||
## Fixed
|
||||
|
||||
- [#3872](https://github.com/hyperf/hyperf/pull/3872) Fixed bug that heartbeat failed when using nacos without default group.
|
||||
- [#3872](https://github.com/hyperf/hyperf/pull/3872) [#3873](https://github.com/hyperf/hyperf/pull/3873) Fixed bug that heartbeat failed when using nacos without default group.
|
||||
- [#3879](https://github.com/hyperf/hyperf/pull/3879) Fixed bug that `watcher` does not work caused by proxies replaced.
|
||||
|
||||
# v2.2.1 - 2021-07-27
|
||||
|
@ -105,7 +105,7 @@ class MainWorkerStartListener implements ListenerInterface
|
||||
|
||||
// Register Instance to Nacos.
|
||||
$instanceConfig = $serviceConfig['instance'] ?? [];
|
||||
$ephemeral = $instanceConfig['ephemeral'] ?? null;
|
||||
$ephemeral = in_array($instanceConfig['ephemeral'], [true, 'true'], true) ? 'true' : 'false';
|
||||
$cluster = $instanceConfig['cluster'] ?? null;
|
||||
$weight = $instanceConfig['weight'] ?? null;
|
||||
$metadata = $instanceConfig['metadata'] ?? null;
|
||||
|
@ -33,6 +33,7 @@ class InstanceBeatProcess extends AbstractProcess
|
||||
|
||||
$serviceConfig = $config->get('nacos.service', []);
|
||||
$serviceName = $serviceConfig['service_name'];
|
||||
$namespaceId = $serviceConfig['namespace_id'];
|
||||
$groupName = $serviceConfig['group_name'] ?? null;
|
||||
$instanceConfig = $serviceConfig['instance'] ?? [];
|
||||
$ephemeral = $instanceConfig['ephemeral'] ?? null;
|
||||
@ -53,10 +54,12 @@ class InstanceBeatProcess extends AbstractProcess
|
||||
[
|
||||
'ip' => $ip,
|
||||
'port' => $port,
|
||||
'serviceName' => $groupName . '@@' . $serviceName,
|
||||
'cluster' => $cluster,
|
||||
'weight' => $weight,
|
||||
],
|
||||
$groupName,
|
||||
$namespaceId,
|
||||
$ephemeral
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user