mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 15:04:22 +00:00
NewXXXServer doesnt run Start or return error
This commit is contained in:
@@ -22,7 +22,7 @@ type GRPCServer struct {
|
||||
}
|
||||
|
||||
// NewGRPCServer returns a new gRPC ABCI server
|
||||
func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (cmn.Service, error) {
|
||||
func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) cmn.Service {
|
||||
parts := strings.SplitN(protoAddr, "://", 2)
|
||||
proto, addr := parts[0], parts[1]
|
||||
s := &GRPCServer{
|
||||
@@ -32,8 +32,7 @@ func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) (cmn.Servi
|
||||
app: app,
|
||||
}
|
||||
s.BaseService = *cmn.NewBaseService(nil, "ABCIServer", s)
|
||||
_, err := s.Start() // Just start it
|
||||
return s, err
|
||||
return s
|
||||
}
|
||||
|
||||
// OnStart starts the gRPC service
|
||||
|
||||
+2
-2
@@ -21,9 +21,9 @@ func NewServer(protoAddr, transport string, app types.Application) (cmn.Service,
|
||||
var err error
|
||||
switch transport {
|
||||
case "socket":
|
||||
s, err = NewSocketServer(protoAddr, app)
|
||||
s = NewSocketServer(protoAddr, app)
|
||||
case "grpc":
|
||||
s, err = NewGRPCServer(protoAddr, types.NewGRPCApplication(app))
|
||||
s = NewGRPCServer(protoAddr, types.NewGRPCApplication(app))
|
||||
default:
|
||||
err = fmt.Errorf("Unknown server type %s", transport)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type SocketServer struct {
|
||||
app types.Application
|
||||
}
|
||||
|
||||
func NewSocketServer(protoAddr string, app types.Application) (cmn.Service, error) {
|
||||
func NewSocketServer(protoAddr string, app types.Application) cmn.Service {
|
||||
parts := strings.SplitN(protoAddr, "://", 2)
|
||||
proto, addr := parts[0], parts[1]
|
||||
s := &SocketServer{
|
||||
@@ -40,10 +40,7 @@ func NewSocketServer(protoAddr string, app types.Application) (cmn.Service, erro
|
||||
conns: make(map[int]net.Conn),
|
||||
}
|
||||
s.BaseService = *cmn.NewBaseService(nil, "ABCIServer", s)
|
||||
// FIXME we are loosing "Starting ABCIServer" message here
|
||||
// add logger to params?
|
||||
_, err := s.Start() // Just start it
|
||||
return s, err
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *SocketServer) OnStart() error {
|
||||
|
||||
Reference in New Issue
Block a user