diff --git a/internal/msg_gateway/gate/relay_rpc_server.go b/internal/msg_gateway/gate/relay_rpc_server.go index b00129d64..406cb991e 100644 --- a/internal/msg_gateway/gate/relay_rpc_server.go +++ b/internal/msg_gateway/gate/relay_rpc_server.go @@ -66,6 +66,7 @@ func (r *RPCServer) run() { err = getcdv3.RegisterEtcd4Unique(r.etcdSchema, strings.Join(r.etcdAddr, ","), rpcRegisterIP, r.rpcPort, r.rpcRegisterName, 10) if err != nil { log.Error("", "register push message rpc to etcd err", "", "err", err.Error(), r.etcdSchema, strings.Join(r.etcdAddr, ","), rpcRegisterIP, r.rpcPort, r.rpcRegisterName) + panic(utils.Wrap(err, "register msg_gataway module rpc to etcd err")) } r.target = getcdv3.GetTarget(r.etcdSchema, rpcRegisterIP, r.rpcPort, r.rpcRegisterName) err = srv.Serve(listener) diff --git a/internal/push/logic/push_rpc_server.go b/internal/push/logic/push_rpc_server.go index 08939ef1a..8be927433 100644 --- a/internal/push/logic/push_rpc_server.go +++ b/internal/push/logic/push_rpc_server.go @@ -55,6 +55,7 @@ func (r *RPCServer) run() { err = getcdv3.RegisterEtcd(r.etcdSchema, strings.Join(r.etcdAddr, ","), rpcRegisterIP, r.rpcPort, r.rpcRegisterName, 10) if err != nil { log.Error("", "register push module rpc to etcd err", err.Error(), r.etcdSchema, strings.Join(r.etcdAddr, ","), rpcRegisterIP, r.rpcPort, r.rpcRegisterName) + panic(utils.Wrap(err, "register push module rpc to etcd err")) } err = srv.Serve(listener) if err != nil { diff --git a/internal/rpc/admin_cms/admin_cms.go b/internal/rpc/admin_cms/admin_cms.go index 19e2dc46b..b61794628 100644 --- a/internal/rpc/admin_cms/admin_cms.go +++ b/internal/rpc/admin_cms/admin_cms.go @@ -69,7 +69,7 @@ func (s *adminCMSServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) - return + panic(utils.Wrap(err, "register admin module rpc to etcd err")) } err = srv.Serve(listener) if err != nil { diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go index a460a9033..ccab54c65 100644 --- a/internal/rpc/auth/auth.go +++ b/internal/rpc/auth/auth.go @@ -156,7 +156,8 @@ func (rpc *rpcAuth) Run() { if err != nil { log.NewError(operationID, "RegisterEtcd failed ", err.Error(), rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName) - return + panic(utils.Wrap(err, "register auth module rpc to etcd err")) + } log.NewInfo(operationID, "RegisterAuthServer ok ", rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName) err = srv.Serve(listener) diff --git a/internal/rpc/cache/cache.go b/internal/rpc/cache/cache.go index 60cc52d32..78bf8c124 100644 --- a/internal/rpc/cache/cache.go +++ b/internal/rpc/cache/cache.go @@ -65,7 +65,7 @@ func (s *cacheServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) - return + panic(utils.Wrap(err, "register cache module rpc to etcd err")) } err = srv.Serve(listener) if err != nil { diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index 6fb04dfd4..87e201aa1 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -198,7 +198,7 @@ func (rpc *rpcConversation) Run() { if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error(), rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName) - return + panic(utils.Wrap(err, "register conversation module rpc to etcd err")) } log.NewInfo("0", "RegisterConversationServer ok ", rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName) err = srv.Serve(listener) diff --git a/internal/rpc/friend/friend.go b/internal/rpc/friend/friend.go index 6a699d278..29ec99eab 100644 --- a/internal/rpc/friend/friend.go +++ b/internal/rpc/friend/friend.go @@ -75,7 +75,7 @@ func (s *friendServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName) - return + panic(utils.Wrap(err, "register friend module rpc to etcd err")) } err = srv.Serve(listener) if err != nil { diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 5b5335329..7a821c34e 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -83,7 +83,8 @@ func (s *groupServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("", "RegisterEtcd failed ", err.Error()) - return + panic(utils.Wrap(err, "register group module rpc to etcd err")) + } log.Info("", "RegisterEtcd ", s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName) err = srv.Serve(listener) diff --git a/internal/rpc/message_cms/message_cms.go b/internal/rpc/message_cms/message_cms.go index f0757e421..58a7e7d4e 100644 --- a/internal/rpc/message_cms/message_cms.go +++ b/internal/rpc/message_cms/message_cms.go @@ -74,7 +74,7 @@ func (s *messageCMSServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) - return + panic(utils.Wrap(err, "register message_cms module rpc to etcd err")) } err = srv.Serve(listener) if err != nil { diff --git a/internal/rpc/msg/rpcChat.go b/internal/rpc/msg/rpcChat.go index 95f0ceaa5..fde8536be 100644 --- a/internal/rpc/msg/rpcChat.go +++ b/internal/rpc/msg/rpcChat.go @@ -75,7 +75,7 @@ func (rpc *rpcChat) Run() { err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName, 10) if err != nil { log.Error("", "register rpcChat to etcd failed ", err.Error()) - return + panic(utils.Wrap(err, "register chat module rpc to etcd err")) } go rpc.runCh() err = srv.Serve(listener) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 828d8b58c..741938ca3 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -82,7 +82,7 @@ func (s *officeServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) - return + panic(utils.Wrap(err, "register office module rpc to etcd err")) } go s.sendTagMsgRoutine() err = srv.Serve(listener) diff --git a/internal/rpc/organization/organization.go b/internal/rpc/organization/organization.go index 95f3233ef..89cd15321 100644 --- a/internal/rpc/organization/organization.go +++ b/internal/rpc/organization/organization.go @@ -73,7 +73,7 @@ func (s *organizationServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("", "RegisterEtcd failed ", err.Error()) - return + panic(utils.Wrap(err, "register organization module rpc to etcd err")) } log.NewInfo("", "organization rpc RegisterEtcd success", rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) err = srv.Serve(listener) diff --git a/internal/rpc/statistics/statistics.go b/internal/rpc/statistics/statistics.go index 920fc9d73..8947c6a74 100644 --- a/internal/rpc/statistics/statistics.go +++ b/internal/rpc/statistics/statistics.go @@ -77,7 +77,7 @@ func (s *statisticsServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error()) - return + panic(utils.Wrap(err, "register statistics module rpc to etcd err")) } err = srv.Serve(listener) if err != nil { diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index a7d7934ca..ad6ef5660 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -76,7 +76,7 @@ func (s *userServer) Run() { err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) if err != nil { log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName) - return + panic(utils.Wrap(err, "register user module rpc to etcd err")) } err = srv.Serve(listener) if err != nil {