test-errcode
wangchuxiao 2 years ago
parent 22e0fc216b
commit 20828746ea

@ -52,7 +52,7 @@ func (r *RootCmd) GetPortFlag() int {
} }
func (r *RootCmd) AddPrometheusPortFlag() { func (r *RootCmd) AddPrometheusPortFlag() {
r.Command.Flags().String(constant.FlagPrometheusPort, "", "server prometheus listen port") r.Command.Flags().IntP(constant.FlagPrometheusPort, "pp", 0, "server prometheus listen port")
} }
func (r *RootCmd) getPrometheusPortFlag(cmd *cobra.Command) int { func (r *RootCmd) getPrometheusPortFlag(cmd *cobra.Command) int {

@ -21,7 +21,7 @@ import (
) )
func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error { func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error {
fmt.Println("start", rpcRegisterName, "rpc server, port: ", rpcPort, "prometheusPort:", prometheusPort, ", OpenIM version: ", config.Version) fmt.Println("start", rpcRegisterName, "server, port: ", rpcPort, "prometheusPort:", prometheusPort, ", OpenIM version: ", config.Version)
log.NewPrivateLog(constant.LogFileName) log.NewPrivateLog(constant.LogFileName)
listener, err := net.Listen("tcp", net.JoinHostPort(config.Config.ListenIP, strconv.Itoa(rpcPort))) listener, err := net.Listen("tcp", net.JoinHostPort(config.Config.ListenIP, strconv.Itoa(rpcPort)))
if err != nil { if err != nil {

Loading…
Cancel
Save