summaryrefslogtreecommitdiff
path: root/plugins/rpc
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-10-20 16:52:55 +0300
committerValery Piashchynski <[email protected]>2020-10-20 16:52:55 +0300
commitf5fe854a632bf778c3b6d04c298fe92a64a1f9b6 (patch)
tree1282e7d91134deb34784a557d19af1a51f0ecca5 /plugins/rpc
parente068cb5bf3f13d1a523f647402d257022b3fd589 (diff)
Update RpcService registration
Diffstat (limited to 'plugins/rpc')
-rw-r--r--plugins/rpc/rpc.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/rpc/rpc.go b/plugins/rpc/rpc.go
index bd3e3b2e..6568eea3 100644
--- a/plugins/rpc/rpc.go
+++ b/plugins/rpc/rpc.go
@@ -79,14 +79,13 @@ func (s *Service) Serve() chan error {
errCh <- err
return errCh
}
- defer func() {
- errCh <- ln.Close()
- }()
go func() {
for {
select {
case <-s.close:
+ // log error
+ errCh <- ln.Close()
return
default:
conn, err := ln.Accept()
@@ -115,8 +114,13 @@ func (s *Service) Depends() []interface{} {
}
func (s *Service) RpcService(p PluginRpc) error {
+ service, err := p.RpcService()
+ if err != nil {
+ return err
+ }
+
s.services = append(s.services, services{
- service: p.RpcService(),
+ service: service,
name: p.Name(),
})
return nil