chore: stabilize lint and verify builds
This commit is contained in:
@@ -17,20 +17,21 @@ func Provide(opts ...opt.Option) error {
|
||||
if err := o.UnmarshalConfig(&config); err != nil {
|
||||
return err
|
||||
}
|
||||
return container.Container.Provide(func(http *http.Service, grpc *grpc.Grpc) (*CMux, error) {
|
||||
l, err := net.Listen("tcp", config.Address())
|
||||
|
||||
return container.Container.Provide(func(httpSvc *http.Service, grpcSvc *grpc.Grpc) (*CMux, error) {
|
||||
listener, err := net.Listen("tcp", config.Address())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mux := &CMux{
|
||||
Http: http,
|
||||
Grpc: grpc,
|
||||
Mux: cmux.New(l),
|
||||
Base: l,
|
||||
HTTP: httpSvc,
|
||||
Grpc: grpcSvc,
|
||||
Mux: cmux.New(listener),
|
||||
Base: listener,
|
||||
}
|
||||
// Ensure cmux stops accepting new connections on shutdown
|
||||
container.AddCloseAble(func() { _ = l.Close() })
|
||||
container.AddCloseAble(func() { _ = listener.Close() })
|
||||
|
||||
return mux, nil
|
||||
}, o.DiOptions()...)
|
||||
|
||||
Reference in New Issue
Block a user