good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
68da9aa7
Commit
68da9aa7
authored
Jul 24, 2018
by
Wenbiao Zheng
Committed by
Felix Lange
Jul 24, 2018
Browse files
Options
Downloads
Patches
Plain Diff
rpc: clean up check for missing methods/subscriptions on handler (#17145)
parent
fe6a9473
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
rpc/server.go
+5
-8
5 additions, 8 deletions
rpc/server.go
with
5 additions
and
8 deletions
rpc/server.go
+
5
−
8
View file @
68da9aa7
...
@@ -94,11 +94,12 @@ func (s *Server) RegisterName(name string, rcvr interface{}) error {
...
@@ -94,11 +94,12 @@ func (s *Server) RegisterName(name string, rcvr interface{}) error {
methods
,
subscriptions
:=
suitableCallbacks
(
rcvrVal
,
svc
.
typ
)
methods
,
subscriptions
:=
suitableCallbacks
(
rcvrVal
,
svc
.
typ
)
// already a previous service register under given sname, merge methods/subscriptions
if
regsvc
,
present
:=
s
.
services
[
name
];
present
{
if
len
(
methods
)
==
0
&&
len
(
subscriptions
)
==
0
{
if
len
(
methods
)
==
0
&&
len
(
subscriptions
)
==
0
{
return
fmt
.
Errorf
(
"Service %T doesn't have any suitable methods/subscriptions to expose"
,
rcvr
)
return
fmt
.
Errorf
(
"Service %T doesn't have any suitable methods/subscriptions to expose"
,
rcvr
)
}
}
// already a previous service register under given name, merge methods/subscriptions
if
regsvc
,
present
:=
s
.
services
[
name
];
present
{
for
_
,
m
:=
range
methods
{
for
_
,
m
:=
range
methods
{
regsvc
.
callbacks
[
formatName
(
m
.
method
.
Name
)]
=
m
regsvc
.
callbacks
[
formatName
(
m
.
method
.
Name
)]
=
m
}
}
...
@@ -111,10 +112,6 @@ func (s *Server) RegisterName(name string, rcvr interface{}) error {
...
@@ -111,10 +112,6 @@ func (s *Server) RegisterName(name string, rcvr interface{}) error {
svc
.
name
=
name
svc
.
name
=
name
svc
.
callbacks
,
svc
.
subscriptions
=
methods
,
subscriptions
svc
.
callbacks
,
svc
.
subscriptions
=
methods
,
subscriptions
if
len
(
svc
.
callbacks
)
==
0
&&
len
(
svc
.
subscriptions
)
==
0
{
return
fmt
.
Errorf
(
"Service %T doesn't have any suitable methods/subscriptions to expose"
,
rcvr
)
}
s
.
services
[
svc
.
name
]
=
svc
s
.
services
[
svc
.
name
]
=
svc
return
nil
return
nil
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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