Rpc Register IP

This commit is contained in:
wenxu12345
2022-06-23 09:24:05 +08:00
parent e4d35c2a86
commit 218340e138
13 changed files with 16 additions and 13 deletions
+2 -1
View File
@@ -134,7 +134,7 @@ func (rpc *rpcAuth) Run() {
//service registers with etcd
pbAuth.RegisterAuthServer(srv, rpc)
rpcRegisterIP := ""
rpcRegisterIP := config.Config.RpcRegisterIP
if config.Config.RpcRegisterIP == "" {
rpcRegisterIP, err = utils.GetLocalIP()
if err != nil {
@@ -142,6 +142,7 @@ func (rpc *rpcAuth) Run() {
}
}
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName, 10)
if err != nil {
log.NewError(operationID, "RegisterEtcd failed ", err.Error(),