Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
getty
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
getty
Commits
a1208bab
Commit
a1208bab
authored
Mar 18, 2019
by
AlexStocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: use latest gxstrings.Contains
parent
d7efa21d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
server.go
micro/server.go
+1
-1
rpc.go
rpc/rpc.go
+2
-2
No files found.
micro/server.go
View file @
a1208bab
...
@@ -81,7 +81,7 @@ func NewServer(conf *rpc.ServerConfig, regConf *ProviderRegistryConfig) (*Server
...
@@ -81,7 +81,7 @@ func NewServer(conf *rpc.ServerConfig, regConf *ProviderRegistryConfig) (*Server
for
_
,
svr
:=
range
regConf
.
ServiceArray
{
for
_
,
svr
:=
range
regConf
.
ServiceArray
{
addr
:=
gxnet
.
HostAddress
(
svr
.
LocalHost
,
svr
.
LocalPort
)
addr
:=
gxnet
.
HostAddress
(
svr
.
LocalHost
,
svr
.
LocalPort
)
if
ok
:=
gxstrings
.
Contains
(
localAddrArr
,
addr
);
!
ok
{
if
ok
:=
gxstrings
.
Contains
(
gxstrings
.
Strings2Ifs
(
localAddrArr
)
,
addr
);
!
ok
{
return
nil
,
jerrors
.
Errorf
(
"can not find ServiceConfig addr %s in conf address array %#v"
,
return
nil
,
jerrors
.
Errorf
(
"can not find ServiceConfig addr %s in conf address array %#v"
,
addr
,
localAddrArr
)
addr
,
localAddrArr
)
}
}
...
...
rpc/rpc.go
View file @
a1208bab
...
@@ -65,7 +65,7 @@ func suitableMethods(typ reflect.Type) map[string]*methodType {
...
@@ -65,7 +65,7 @@ func suitableMethods(typ reflect.Type) map[string]*methodType {
// notify Method needs two ins: receiver, *args.
// notify Method needs two ins: receiver, *args.
mInNum
:=
mtype
.
NumIn
()
mInNum
:=
mtype
.
NumIn
()
if
mInNum
!=
2
&&
mInNum
!=
3
{
if
mInNum
!=
2
&&
mInNum
!=
3
{
log
.
Warn
(
"method %s has wrong number of ins %d which should be "
+
log
.
Warn
(
"method %s has wrong number of ins %d which should be "
+
"2(notify method) or 3(serive method)"
,
mname
,
mtype
.
NumIn
())
"2(notify method) or 3(serive method)"
,
mname
,
mtype
.
NumIn
())
continue
continue
}
}
...
...
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