Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
a7b3fd84
Commit
a7b3fd84
authored
5 years ago
by
邹毅贤
Browse files
Options
Downloads
Patches
Plain Diff
fix review comment
parent
bd165e54
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config_center/nacos/client.go
+5
-6
5 additions, 6 deletions
config_center/nacos/client.go
config_center/nacos/impl.go
+5
-4
5 additions, 4 deletions
config_center/nacos/impl.go
config_center/nacos/listener.go
+2
-1
2 additions, 1 deletion
config_center/nacos/listener.go
with
12 additions
and
11 deletions
config_center/nacos/client.go
+
5
−
6
View file @
a7b3fd84
...
...
@@ -61,16 +61,14 @@ func WithNacosName(name string) option {
// ValidateNacosClient Validate nacos client , if null then create it
func
ValidateNacosClient
(
container
nacosClientFacade
,
opts
...
option
)
error
{
var
(
err
error
)
if
container
==
nil
{
return
perrors
.
Errorf
(
"container can not be null"
)
}
os
:=
&
options
{}
for
_
,
opt
:=
range
opts
{
opt
(
os
)
}
err
=
nil
url
:=
container
.
GetUrl
()
if
container
.
NacosClient
()
==
nil
{
...
...
@@ -123,7 +121,7 @@ func ValidateNacosClient(container nacosClientFacade, opts ...option) error {
}
}
return
perrors
.
WithMessagef
(
err
,
"newNacosClient(address:%+v)"
,
url
.
PrimitiveURL
)
return
perrors
.
WithMessagef
(
nil
,
"newNacosClient(address:%+v)"
,
url
.
PrimitiveURL
)
}
func
newNacosClient
(
name
string
,
nacosAddrs
[]
string
,
timeout
time
.
Duration
)
(
*
NacosClient
,
error
)
{
...
...
@@ -147,6 +145,7 @@ func newNacosClient(name string, nacosAddrs []string, timeout time.Duration) (*N
split
:=
strings
.
Split
(
nacosAddr
,
":"
)
port
,
err
:=
strconv
.
ParseUint
(
split
[
1
],
10
,
64
)
if
err
!=
nil
{
logger
.
Warnf
(
"convert port , source:%s , error:%v "
,
split
[
1
],
err
)
continue
}
svrconf
:=
nacosconst
.
ServerConfig
{
...
...
This diff is collapsed.
Click to expand it.
config_center/nacos/impl.go
+
5
−
4
View file @
a7b3fd84
...
...
@@ -159,9 +159,10 @@ func (n *nacosDynamicConfiguration) IsAvailable() bool {
func
(
r
*
nacosDynamicConfiguration
)
closeConfigs
()
{
r
.
cltLock
.
Lock
()
defer
r
.
cltLock
.
Unlock
()
logger
.
Infof
(
"begin to close provider nacos client"
)
// Close the old client first to close the tmp node
r
.
client
.
Close
()
client
:=
r
.
client
r
.
client
=
nil
r
.
cltLock
.
Unlock
()
// Close the old client first to close the tmp node
client
.
Close
()
logger
.
Infof
(
"begin to close provider nacos client"
)
}
This diff is collapsed.
Click to expand it.
config_center/nacos/listener.go
+
2
−
1
View file @
a7b3fd84
...
...
@@ -57,5 +57,6 @@ func (l *nacosDynamicConfiguration) addListener(key string, listener config_cent
}
func
(
l
*
nacosDynamicConfiguration
)
removeListener
(
key
string
,
listener
config_center
.
ConfigurationListener
)
{
// TODO not supported in current go_nacos_sdk version
// TODO: not supported in current go_nacos_sdk version
logger
.
Warn
(
"not supported in current go_nacos_sdk version"
)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment