summaryrefslogtreecommitdiff
path: root/plugins/rpc
diff options
context:
space:
mode:
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