test group

This commit is contained in:
wangchuxiao
2023-05-09 18:34:20 +08:00
parent 17e747049c
commit 9ea3e4c758
3 changed files with 15 additions and 14 deletions
+5
View File
@@ -1,6 +1,8 @@
package cmd
import (
"errors"
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/startrpc"
"github.com/spf13/cobra"
@@ -25,5 +27,8 @@ func (a *RpcCmd) Exec() error {
}
func (a *RpcCmd) StartSvr(name string, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error) error {
if a.GetPortFlag() == 0 {
return errors.New("port is required")
}
return startrpc.Start(a.GetPortFlag(), name, a.GetPrometheusPortFlag(), rpcFn)
}