mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Added optional configuration url for nacos which used to request nacos server. (#3211)
Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
parent
1f40236e35
commit
7d32ef4780
@ -8,6 +8,7 @@
|
||||
|
||||
## Added
|
||||
|
||||
- [#3211](https://github.com/hyperf/hyperf/pull/3211) Added optional configuration url for nacos which used to request nacos server.
|
||||
- [#3214](https://github.com/hyperf/hyperf/pull/3214) Added Caller which help you to use instance in coroutine security mode.
|
||||
|
||||
## Changed
|
||||
|
@ -13,6 +13,8 @@ use Hyperf\Nacos\Constants;
|
||||
|
||||
return [
|
||||
'enable' => true,
|
||||
// nacos server url like https://nacos.hyperf.io, Priority is higher than host:port
|
||||
// 'url' => '',
|
||||
// The nacos host info
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 8848,
|
||||
|
@ -52,6 +52,12 @@ abstract class AbstractNacos
|
||||
|
||||
public function getServerUri(): string
|
||||
{
|
||||
$url = $this->config->get('nacos.url');
|
||||
|
||||
if ($url) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'%s:%d',
|
||||
$this->config->get('nacos.host', '127.0.0.1'),
|
||||
|
Loading…
Reference in New Issue
Block a user