mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-02 18:34:29 +08:00
feat: fix openim tools error code
This commit is contained in:
parent
683d3d2202
commit
99b938d9b6
@ -140,7 +140,7 @@ func (r *RootCmd) getPortFlag(cmd *cobra.Command) (int, error) {
|
||||
return 0, errors.Wrap(err, "error getting port flag")
|
||||
}
|
||||
if port == 0 {
|
||||
port = r.PortFromConfig(constant.FlagPort)
|
||||
port, _ = r.PortFromConfig(constant.FlagPort)
|
||||
// port, err := r.PortFromConfig(constant.FlagPort)
|
||||
// if err != nil {
|
||||
// // Optionally wrap the error if it's an internal error needing context
|
||||
@ -166,7 +166,7 @@ func (r *RootCmd) AddPrometheusPortFlag() {
|
||||
func (r *RootCmd) getPrometheusPortFlag(cmd *cobra.Command) (int, error) {
|
||||
port, _ := cmd.Flags().GetInt(constant.FlagPrometheusPort)
|
||||
if port == 0 {
|
||||
port = r.PortFromConfig(constant.FlagPrometheusPort)
|
||||
port, _ = r.PortFromConfig(constant.FlagPrometheusPort)
|
||||
}
|
||||
return port, nil
|
||||
}
|
||||
@ -189,8 +189,7 @@ func (r *RootCmd) AddCommand(cmds ...*cobra.Command) {
|
||||
r.Command.AddCommand(cmds...)
|
||||
}
|
||||
|
||||
func (r *RootCmd)
|
||||
PortFromConfig(portType string) (int, error) {
|
||||
func (r *RootCmd) PortFromConfig(portType string) (int, error) {
|
||||
// Retrieve the port and cache it
|
||||
port, err := r.cmdItf.GetPortFromConfig(portType)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user