OpenIMCommonConfigKey

This commit is contained in:
withchao 2023-03-21 15:33:33 +08:00
parent c036d27b36
commit 119f8bf820
2 changed files with 11 additions and 0 deletions

View File

@ -1,8 +1,10 @@
package main package main
import ( import (
"bytes"
"context" "context"
"fmt" "fmt"
"gopkg.in/yaml.v3"
"net" "net"
"strconv" "strconv"
@ -37,6 +39,13 @@ func run(port int) error {
if err != nil { if err != nil {
return err return err
} }
buf := bytes.NewBuffer(nil)
if err := yaml.NewEncoder(buf).Encode(config.Config); err != nil {
return err
}
if err := zk.RegisterConf2Registry(constant.OpenIMCommonConfigKey, buf.Bytes()); err != nil {
return err
}
log.NewPrivateLog(constant.LogFileName) log.NewPrivateLog(constant.LogFileName)
router := api.NewGinRouter(zk, rdb) router := api.NewGinRouter(zk, rdb)
var address string var address string

View File

@ -325,3 +325,5 @@ const (
FlagPrometheusPort = "prometheus_port" FlagPrometheusPort = "prometheus_port"
FlagConf = "config_folder_path" FlagConf = "config_folder_path"
) )
const OpenIMCommonConfigKey = "OpenIMServerConfig"