This commit is contained in:
wangchuxiao 2023-03-09 15:07:35 +08:00
parent a957f2227b
commit 946fba17ef

View File

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