Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gostnops
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
gostnops
Commits
2fc80bb1
Commit
2fc80bb1
authored
Feb 10, 2021
by
ztelur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linter problem
parent
92bf5baf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
client.go
remoting/etcd3/client.go
+2
-1
No files found.
remoting/etcd3/client.go
View file @
2fc80bb1
...
...
@@ -127,7 +127,6 @@ type Client struct {
// NewClient create a client instance with name, endpoints etc.
func
NewClient
(
name
string
,
endpoints
[]
string
,
timeout
time
.
Duration
,
heartbeat
int
)
(
*
Client
,
error
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
rawClient
,
err
:=
clientv3
.
New
(
clientv3
.
Config
{
Context
:
ctx
,
...
...
@@ -136,6 +135,7 @@ func NewClient(name string, endpoints []string, timeout time.Duration, heartbeat
DialOptions
:
[]
grpc
.
DialOption
{
grpc
.
WithBlock
()},
})
if
err
!=
nil
{
cancel
()
return
nil
,
perrors
.
WithMessage
(
err
,
"new raw client block connect to server"
)
}
...
...
@@ -153,6 +153,7 @@ func NewClient(name string, endpoints []string, timeout time.Duration, heartbeat
}
if
err
:=
c
.
maintenanceStatus
();
err
!=
nil
{
cancel
()
return
nil
,
perrors
.
WithMessage
(
err
,
"client maintenance status"
)
}
return
c
,
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment