mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
Fix Script Error and Enhance Code Robustness and Details (#1890)
* feat: add openim deployment tactics Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add openim deployment tactics Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * fix: set openim admin chat code Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * fix: set openim admin chat code Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * fix: fix openim msgtransfer code * fix: fix openim msgtransfer code --------- Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
@@ -15,8 +15,6 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/OpenIMSDK/protocol/constant"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -41,7 +39,6 @@ func (a *ApiCmd) AddApi(f func(port int, promPort int) error) {
|
||||
}
|
||||
|
||||
func (a *ApiCmd) GetPortFromConfig(portType string) int {
|
||||
fmt.Println("GetPortFromConfig:", portType)
|
||||
if portType == constant.FlagPort {
|
||||
return config2.Config.Api.OpenImApiPort[0]
|
||||
} else if portType == constant.FlagPrometheusPort {
|
||||
|
||||
@@ -47,7 +47,6 @@ func (m *MsgTransferCmd) Exec() error {
|
||||
}
|
||||
|
||||
func (m *MsgTransferCmd) GetPortFromConfig(portType string) int {
|
||||
fmt.Println("GetPortFromConfig:", portType)
|
||||
if portType == constant.FlagPort {
|
||||
return 0
|
||||
} else if portType == constant.FlagPrometheusPort {
|
||||
@@ -56,9 +55,11 @@ func (m *MsgTransferCmd) GetPortFromConfig(portType string) int {
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MsgTransferCmd) AddTransferProgressFlag() {
|
||||
m.Command.Flags().IntP(constant.FlagTransferProgressIndex, "n", 0, "transfer progress index")
|
||||
}
|
||||
|
||||
func (m *MsgTransferCmd) getTransferProgressFlagValue() int {
|
||||
nindex, err := m.Command.Flags().GetInt(constant.FlagTransferProgressIndex)
|
||||
if err != nil {
|
||||
|
||||
@@ -163,7 +163,7 @@ func (r *RootCmd) GetPrometheusPortFlag() int {
|
||||
|
||||
func (r *RootCmd) getConfFromCmdAndInit(cmdLines *cobra.Command) error {
|
||||
configFolderPath, _ := cmdLines.Flags().GetString(constant.FlagConf)
|
||||
fmt.Println("configFolderPath:", configFolderPath)
|
||||
fmt.Println("The directory of the configuration file to start the process:", configFolderPath)
|
||||
return config2.InitConfig(configFolderPath)
|
||||
}
|
||||
|
||||
@@ -176,10 +176,9 @@ func (r *RootCmd) AddCommand(cmds ...*cobra.Command) {
|
||||
}
|
||||
|
||||
func (r *RootCmd) GetPortFromConfig(portType string) int {
|
||||
fmt.Println("RootCmd.GetPortFromConfig:", portType)
|
||||
return 0
|
||||
}
|
||||
|
||||
func (r *RootCmd) PortFromConfig(portType string) int {
|
||||
fmt.Println("PortFromConfig:", portType)
|
||||
return r.cmdItf.GetPortFromConfig(portType)
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ func initConfig(config any, configName, configFolderPath string) error {
|
||||
if err = yaml.Unmarshal(data, config); err != nil {
|
||||
return fmt.Errorf("unmarshal yaml error: %w", err)
|
||||
}
|
||||
fmt.Println("use config", configFolderPath)
|
||||
fmt.Println("The path of the configuration file to start the process:", configFolderPath)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user