test-errcode
wangchuxiao 2 years ago
parent a957f2227b
commit 946fba17ef

@ -52,11 +52,16 @@ func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(c
if err != nil {
return utils.Wrap1(err)
}
if config.Config.Prometheus.Enable && prometheusPort != 0 {
err := prome.StartPrometheusSrv(prometheusPort)
if err != nil {
return err
go func() {
if config.Config.Prometheus.Enable && prometheusPort != 0 {
if err := prome.StartPrometheusSrv(prometheusPort); err != nil {
panic(err.Error())
}
}
}()
err = srv.Serve(listener)
if err != nil {
return utils.Wrap1(err)
}
return rpcFn(zkClient, srv)
}

Loading…
Cancel
Save