mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-14 22:15:59 +08:00
Rpc Register IP
This commit is contained in:
@@ -56,7 +56,7 @@ func (s *adminCMSServer) Run() {
|
||||
defer srv.GracefulStop()
|
||||
//Service registers with etcd
|
||||
pbAdminCMS.RegisterAdminCMSServer(srv, s)
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Vendored
+1
-1
@@ -65,7 +65,7 @@ func (s *cacheServer) Run() {
|
||||
defer srv.GracefulStop()
|
||||
pbCache.RegisterCacheServer(srv, s)
|
||||
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
|
||||
@@ -157,7 +157,7 @@ func (rpc *rpcConversation) Run() {
|
||||
|
||||
//service registers with etcd
|
||||
pbConversation.RegisterConversationServer(srv, rpc)
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
|
||||
@@ -66,7 +66,7 @@ func (s *groupServer) Run() {
|
||||
pbGroup.RegisterGroupServer(srv, s)
|
||||
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if rpcRegisterIP == "" {
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
log.Error("", "GetLocalIP failed ", err.Error())
|
||||
|
||||
@@ -63,7 +63,7 @@ func (s *messageCMSServer) Run() {
|
||||
defer srv.GracefulStop()
|
||||
//Service registers with etcd
|
||||
pbMessageCMS.RegisterMessageCMSServer(srv, s)
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
|
||||
@@ -64,7 +64,7 @@ func (rpc *rpcChat) Run() {
|
||||
srv := grpc.NewServer()
|
||||
defer srv.GracefulStop()
|
||||
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
pbChat.RegisterChatServer(srv, rpc)
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
|
||||
@@ -71,7 +71,7 @@ func (s *officeServer) Run() {
|
||||
defer srv.GracefulStop()
|
||||
//Service registers with etcd
|
||||
pbOffice.RegisterOfficeServiceServer(srv, s)
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
|
||||
@@ -61,7 +61,7 @@ func (s *organizationServer) Run() {
|
||||
defer srv.GracefulStop()
|
||||
//Service registers with etcd
|
||||
rpc.RegisterOrganizationServer(srv, s)
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
|
||||
@@ -67,7 +67,7 @@ func (s *statisticsServer) Run() {
|
||||
defer srv.GracefulStop()
|
||||
//Service registers with etcd
|
||||
pbStatistics.RegisterUserServer(srv, s)
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
|
||||
@@ -62,7 +62,7 @@ func (s *userServer) Run() {
|
||||
defer srv.GracefulStop()
|
||||
//Service registers with etcd
|
||||
pbUser.RegisterUserServer(srv, s)
|
||||
rpcRegisterIP := ""
|
||||
rpcRegisterIP := config.Config.RpcRegisterIP
|
||||
if config.Config.RpcRegisterIP == "" {
|
||||
rpcRegisterIP, err = utils.GetLocalIP()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user