move codec registration to init phase
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
3d522b094b
commit
f0b6370ee1
8
grpc.go
8
grpc.go
@ -128,6 +128,10 @@ func (g *Server) configure(opts ...server.Option) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, k := range g.opts.Codecs {
|
||||||
|
encoding.RegisterCodec(&wrapMicroCodec{k})
|
||||||
|
}
|
||||||
|
|
||||||
maxMsgSize := g.getMaxMsgSize()
|
maxMsgSize := g.getMaxMsgSize()
|
||||||
|
|
||||||
gopts := []grpc.ServerOption{
|
gopts := []grpc.ServerOption{
|
||||||
@ -809,10 +813,6 @@ func (g *Server) Start() error {
|
|||||||
|
|
||||||
config := g.Options()
|
config := g.Options()
|
||||||
|
|
||||||
for _, k := range config.Codecs {
|
|
||||||
encoding.RegisterCodec(&wrapMicroCodec{k})
|
|
||||||
}
|
|
||||||
|
|
||||||
// micro: config.Transport.Listen(config.Address)
|
// micro: config.Transport.Listen(config.Address)
|
||||||
var ts net.Listener
|
var ts net.Listener
|
||||||
var err error
|
var err error
|
||||||
|
Loading…
Reference in New Issue
Block a user