mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-11 23:47:32 +08:00
fix: fix openim config path
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
parent
ab2ac119d2
commit
34f6eedd5b
@ -49,11 +49,13 @@ func run(port int) error {
|
|||||||
if port == 0 {
|
if port == 0 {
|
||||||
err := "port is empty"
|
err := "port is empty"
|
||||||
log.ZError(context.Background(), err, nil)
|
log.ZError(context.Background(), err, nil)
|
||||||
|
|
||||||
return fmt.Errorf(err)
|
return fmt.Errorf(err)
|
||||||
}
|
}
|
||||||
rdb, err := cache.NewRedis()
|
rdb, err := cache.NewRedis()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZError(context.Background(), "Failed to initialize Redis", err)
|
log.ZError(context.Background(), "Failed to initialize Redis", err)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.ZInfo(context.Background(), "api start init discov client")
|
log.ZInfo(context.Background(), "api start init discov client")
|
||||||
@ -64,15 +66,18 @@ func run(port int) error {
|
|||||||
client, err = discovery_register.NewDiscoveryRegister(config.Config.Envs.Discovery)
|
client, err = discovery_register.NewDiscoveryRegister(config.Config.Envs.Discovery)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZError(context.Background(), "Failed to initialize discovery register", err)
|
log.ZError(context.Background(), "Failed to initialize discovery register", err)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err = client.CreateRpcRootNodes(config.Config.GetServiceNames()); err != nil {
|
if err = client.CreateRpcRootNodes(config.Config.GetServiceNames()); err != nil {
|
||||||
log.ZError(context.Background(), "Failed to create RPC root nodes", err)
|
log.ZError(context.Background(), "Failed to create RPC root nodes", err)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.ZInfo(context.Background(), "api register public config to discov")
|
log.ZInfo(context.Background(), "api register public config to discov")
|
||||||
if err = client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, config.Config.EncodeConfig()); err != nil {
|
if err = client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, config.Config.EncodeConfig()); err != nil {
|
||||||
log.ZError(context.Background(), "Failed to register public config to discov", err)
|
log.ZError(context.Background(), "Failed to register public config to discov", err)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.ZInfo(context.Background(), "api register public config to discov success")
|
log.ZInfo(context.Background(), "api register public config to discov success")
|
||||||
@ -89,6 +94,7 @@ func run(port int) error {
|
|||||||
err = router.Run(address)
|
err = router.Run(address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZError(context.Background(), "api run failed", err, "address", address)
|
log.ZError(context.Background(), "api run failed", err, "address", address)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,6 +97,7 @@ func (rc *RootCmd) applyOptions(opts ...func(*CmdOpts)) *CmdOpts {
|
|||||||
|
|
||||||
func (rc *RootCmd) initializeLogger(cmdOpts *CmdOpts) error {
|
func (rc *RootCmd) initializeLogger(cmdOpts *CmdOpts) error {
|
||||||
logConfig := config.Config.Log
|
logConfig := config.Config.Log
|
||||||
|
|
||||||
return log.InitFromConfig(
|
return log.InitFromConfig(
|
||||||
|
|
||||||
cmdOpts.loggerPrefixName,
|
cmdOpts.loggerPrefixName,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user