From cb881e81a8d3e9bf3cc32dbac9fa2c1e641f30a7 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Mon, 22 Aug 2022 19:19:30 +0800 Subject: [PATCH 01/25] log for cost time --- internal/rpc/msg/send_msg.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 9042a5033..b3cf8e5d7 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -225,6 +225,7 @@ func (rpc *rpcChat) encapsulateMsgData(msg *sdk_ws.MsgData) { func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.SendMsgResp, error) { replay := pbChat.SendMsgResp{} newTime := db.GetCurrentTimestampByMill() + t1 := time.Now() log.Info(pb.OperationID, "rpc sendMsg come here ", pb.String()) flag, errCode, errMsg := isMessageHasReadEnabled(pb) log.Info(pb.OperationID, "isMessageHasReadEnabled ", flag) @@ -232,15 +233,18 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S return returnMsg(&replay, pb, errCode, errMsg, "", 0) } flag, errCode, errMsg, _ = messageVerification(pb) - log.Info(pb.OperationID, "userRelationshipVerification ", flag) + log.Info(pb.OperationID, "messageVerification ", flag, " cost time: ", time.Since(t1)) if !flag { return returnMsg(&replay, pb, errCode, errMsg, "", 0) } + t1 = time.Now() rpc.encapsulateMsgData(pb.MsgData) + log.Info(pb.OperationID, "encapsulateMsgData ", " cost time: ", time.Since(t1)) msgToMQSingle := pbChat.MsgDataToMQ{Token: pb.Token, OperationID: pb.OperationID, MsgData: pb.MsgData} // callback + t1 = time.Now() callbackResp := callbackWordFilter(pb) - log.Info(pb.OperationID, "callbackWordFilter ", callbackResp) + log.Info(pb.OperationID, "callbackWordFilter ", callbackResp, "cost time: ", time.Since(t1)) if callbackResp.ErrCode != 0 { log.Error(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter resp: ", callbackResp) } @@ -255,7 +259,9 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S switch pb.MsgData.SessionType { case constant.SingleChatType: // callback + t1 = time.Now() callbackResp := callbackBeforeSendSingleMsg(pb) + log.Info(pb.OperationID, "callbackBeforeSendSingleMsg ", " cost time: ", time.Since(t1)) if callbackResp.ErrCode != 0 { log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg resp: ", callbackResp) } @@ -266,28 +272,37 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", "end rpc and return", callbackResp) return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) } + t1 = time.Now() isSend := modifyMessageByUserMessageReceiveOpt(pb.MsgData.RecvID, pb.MsgData.SendID, constant.SingleChatType, pb) + log.Info(pb.OperationID, "modifyMessageByUserMessageReceiveOpt ", " cost time: ", time.Since(t1)) if isSend { msgToMQSingle.MsgData = pb.MsgData log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle) + t1 = time.Now() err1 := rpc.sendMsgToKafka(&msgToMQSingle, msgToMQSingle.MsgData.RecvID, constant.OnlineStatus) + log.Info(pb.OperationID, "sendMsgToKafka ", " cost time: ", time.Since(t1)) if err1 != nil { log.NewError(msgToMQSingle.OperationID, "kafka send msg err :RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String(), err1.Error()) return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } } if msgToMQSingle.MsgData.SendID != msgToMQSingle.MsgData.RecvID { //Filter messages sent to yourself + t1 = time.Now() err2 := rpc.sendMsgToKafka(&msgToMQSingle, msgToMQSingle.MsgData.SendID, constant.OnlineStatus) + log.Info(pb.OperationID, "sendMsgToKafka ", " cost time: ", time.Since(t1)) if err2 != nil { log.NewError(msgToMQSingle.OperationID, "kafka send msg err:SendID", msgToMQSingle.MsgData.SendID, msgToMQSingle.String()) return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } } // callback + t1 = time.Now() callbackResp = callbackAfterSendSingleMsg(pb) + log.Info(pb.OperationID, "callbackAfterSendSingleMsg ", " cost time: ", time.Since(t1)) if callbackResp.ErrCode != 0 { log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSingleMsg resp: ", callbackResp) } + log.Debug(pb.OperationID, "send msg cost time all: ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID) return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime) case constant.GroupChatType: // callback From 4bd4e0863ccb93d579707912aa210d41e504775e Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 22 Aug 2022 20:00:05 +0800 Subject: [PATCH 02/25] conversation update --- internal/rpc/conversation/conversaion.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index 023169a6b..6fb04dfd4 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -84,6 +84,10 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo for _, v := range utils.DifferenceString(haveUserID, req.UserIDList) { conversation.OwnerUserID = v conversation.UpdateUnreadCountTime = utils.GetCurrentTimestampByMill() + err = rocksCache.DelUserConversationIDListFromCache(v) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), v, req.Conversation.ConversationID, err.Error()) + } err := imdb.SetOneConversation(conversation) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) From ec0cd9a3488fd2cd42fd7fda33454c7bfc716ebd Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 23 Aug 2022 12:06:44 +0800 Subject: [PATCH 03/25] conversation update --- internal/rpc/user/user.go | 9 +++++++-- .../db/mysql_model/im_mysql_model/conversation_model.go | 8 +++++--- pkg/common/db/rocks_cache/rocks_cache.go | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index 9bf06b8fc..a7d7934ca 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -316,13 +316,18 @@ func (s *userServer) SetRecvMsgOpt(ctx context.Context, req *pbUser.SetRecvMsgOp conversation.ConversationType = constant.GroupChatType } } - err := imdb.SetRecvMsgOpt(conversation) + isUpdate, err := imdb.SetRecvMsgOpt(conversation) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} return resp, nil } - if err = rocksCache.DelConversationFromCache(conversation.OwnerUserID, conversation.ConversationID); err != nil { + if isUpdate { + err = rocksCache.DelConversationFromCache(conversation.OwnerUserID, conversation.ConversationID) + } else { + err = rocksCache.DelUserConversationIDListFromCache(conversation.OwnerUserID) + } + if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), conversation.ConversationID, err.Error()) } chat.ConversationChangeNotification(req.OperationID, req.OwnerUserID) diff --git a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go index 2a645d54f..52fe1dcb9 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/conversation_model.go @@ -41,16 +41,18 @@ func PeerUserSetConversation(conversation db.Conversation) error { } -func SetRecvMsgOpt(conversation db.Conversation) error { +func SetRecvMsgOpt(conversation db.Conversation) (bool, error) { + var isUpdate bool newConversation := conversation if db.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") - return db.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Create(conversation).Error + return isUpdate, db.DB.MysqlDB.DefaultGormDB().Model(&db.Conversation{}).Create(conversation).Error // if exist, then update record } else { log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") //force update - return db.DB.MysqlDB.DefaultGormDB().Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). + isUpdate = true + return isUpdate, db.DB.MysqlDB.DefaultGormDB().Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). Updates(map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt}).Error } } diff --git a/pkg/common/db/rocks_cache/rocks_cache.go b/pkg/common/db/rocks_cache/rocks_cache.go index 0cb41a8b5..a510b67a0 100644 --- a/pkg/common/db/rocks_cache/rocks_cache.go +++ b/pkg/common/db/rocks_cache/rocks_cache.go @@ -454,7 +454,7 @@ func GetUserConversationIDListFromCache(userID string) ([]string, error) { } func DelUserConversationIDListFromCache(userID string) error { - return db.DB.Rc.TagAsDeleted(conversationIDListCache + userID) + return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationIDListCache+userID), "DelUserConversationIDListFromCache err") } func GetConversationFromCache(ownerUserID, conversationID string) (*db.Conversation, error) { @@ -511,5 +511,5 @@ func GetUserAllConversationList(ownerUserID string) ([]db.Conversation, error) { } func DelConversationFromCache(ownerUserID, conversationID string) error { - return db.DB.Rc.TagAsDeleted(conversationCache + ownerUserID + ":" + conversationID) + return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationCache+ownerUserID+":"+conversationID), "DelConversationFromCache err") } From f0a9c63cd31534be49e9c509fecd05070782d120 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 23 Aug 2022 12:35:50 +0800 Subject: [PATCH 04/25] log for remote ip --- internal/msg_gateway/gate/ws_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 2ed590bce..29ec4f8ea 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -282,7 +282,7 @@ func (ws *WServer) sendKickMsg(oldConn, newConn *UserConn) { func (ws *WServer) addUserConn(uid string, platformID int, conn *UserConn, token string, operationID string) { rwLock.Lock() defer rwLock.Unlock() - log.Info(operationID, utils.GetSelfFuncName(), " args: ", uid, platformID, conn, token) + log.Info(operationID, utils.GetSelfFuncName(), " args: ", uid, platformID, conn, token, "ip: ", conn.RemoteAddr().String()) callbackResp := callbackUserOnline(operationID, uid, platformID, token) if callbackResp.ErrCode != 0 { log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOnline resp:", callbackResp) From 2dab179166dd374391c1a232ce5e1e9341098f43 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 23 Aug 2022 19:13:56 +0800 Subject: [PATCH 05/25] conversation --- pkg/base_info/conversation_api_struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/base_info/conversation_api_struct.go b/pkg/base_info/conversation_api_struct.go index c0cb9fccf..be913a3c0 100644 --- a/pkg/base_info/conversation_api_struct.go +++ b/pkg/base_info/conversation_api_struct.go @@ -45,7 +45,7 @@ type Conversation struct { IsPrivateChat bool `json:"isPrivateChat"` GroupAtType int32 `json:"groupAtType"` IsNotInGroup bool `json:"isNotInGroup"` - UpdateUnreadCountTime int64 ` json:"updateUnreadCountTime"` + UpdateUnreadCountTime int64 `json:"updateUnreadCountTime"` AttachedInfo string `json:"attachedInfo"` Ex string `json:"ex"` } From aa2d07ca8dd6ebe5920911a15eb55c3fdd888f4c Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 14:22:47 +0800 Subject: [PATCH 06/25] callback add ex field and sdk server shell update --- config/config.yaml | 3 +++ internal/rpc/msg/callback.go | 3 ++- pkg/call_back_struct/common.go | 1 + script/sdk_svr_start.sh | 12 ++++-------- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 5524a1219..984d8175a 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -102,6 +102,9 @@ cmsapi: sdk: openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 dataDir: [ ../db/sdk/ ] + openImWsAddress: + openImApiAddress: + #对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器) credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改 tencent: diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index e00ee001a..e60a1ff3c 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -29,6 +29,7 @@ func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbApi.CommonCallbackReq SenderFaceURL: msg.MsgData.SenderFaceURL, Content: callback.GetContent(msg.MsgData), Seq: msg.MsgData.Seq, + Ex: msg.MsgData.Ex, } return req } @@ -137,11 +138,11 @@ func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp } func callbackWordFilter(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp { + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) callbackResp := cbApi.CommonCallbackResp{OperationID: msg.OperationID} if !config.Config.Callback.CallbackWordFilter.Enable || msg.MsgData.ContentType != constant.Text { return callbackResp } - log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) commonCallbackReq := copyCallbackCommonReqStruct(msg) commonCallbackReq.CallbackCommand = constant.CallbackWordFilterCommand req := cbApi.CallbackWordFilterReq{ diff --git a/pkg/call_back_struct/common.go b/pkg/call_back_struct/common.go index ea61818e5..c3e5a4a71 100644 --- a/pkg/call_back_struct/common.go +++ b/pkg/call_back_struct/common.go @@ -17,6 +17,7 @@ type CommonCallbackReq struct { Seq uint32 `json:"seq"` AtUserIDList []string `json:"atUserList"` SenderFaceURL string `json:"faceURL"` + Ex string `json:"ex"` } type CommonCallbackResp struct { diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh index 5ac90501d..f362e6d2d 100644 --- a/script/sdk_svr_start.sh +++ b/script/sdk_svr_start.sh @@ -4,17 +4,13 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh ulimit -n 200000 -list1=$(cat $config_path | grep openImApiPort | awk -F '[:]' '{print $NF}') -list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') + +ws_address=$(cat $config_path | grep openImWsAddress | awk -F '[:]' '{print $NF}') +api_address=$(cat $config_path | grep openImApiAddress | awk -F '[:]' '{print $NF}') list3=$(cat $config_path | grep openImSdkWsPort | awk -F '[:]' '{print $NF}') logLevel=$(cat $config_path | grep remainLogLevel | awk -F '[:]' '{print $NF}') -list_to_string $list1 -api_ports=($ports_array) -list_to_string $list2 -ws_ports=($ports_array) list_to_string $list3 sdk_ws_ports=($ports_array) -list_to_string $list4 @@ -28,7 +24,7 @@ fi #Waiting port recycling sleep 1 cd ${sdk_server_binary_root} - nohup ./${sdk_server_name} -openIM_api_port ${api_ports[0]} -openIM_ws_port ${ws_ports[0]} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & + nohup ./${sdk_server_name} -openIM_api_address ${api_address} -openIM_ws_address ${ws_address} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & #Check launched service process sleep 3 From 203bfbe4115c5ee5ae01a60303d28fe081981da1 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 15:20:01 +0800 Subject: [PATCH 07/25] callback add ex field and sdk server shell update --- config/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 984d8175a..ab24c920f 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -102,8 +102,8 @@ cmsapi: sdk: openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 dataDir: [ ../db/sdk/ ] - openImWsAddress: - openImApiAddress: + openImWsAddress: "" + openImApiAddress: "" #对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器) credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改 From 0befceef9a31b1fe182d9bed6313a4fd0b31917e Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 15:26:33 +0800 Subject: [PATCH 08/25] callback add ex field and sdk server shell update --- config/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index ab24c920f..984d8175a 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -102,8 +102,8 @@ cmsapi: sdk: openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 dataDir: [ ../db/sdk/ ] - openImWsAddress: "" - openImApiAddress: "" + openImWsAddress: + openImApiAddress: #对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器) credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改 From a2a71ff8f5b444c19a19faa55879a67f587b4a6e Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 15:38:57 +0800 Subject: [PATCH 09/25] callback add ex field and sdk server shell update --- script/sdk_svr_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh index f362e6d2d..2f16c9834 100644 --- a/script/sdk_svr_start.sh +++ b/script/sdk_svr_start.sh @@ -24,7 +24,7 @@ fi #Waiting port recycling sleep 1 cd ${sdk_server_binary_root} - nohup ./${sdk_server_name} -openIM_api_address ${api_address} -openIM_ws_address ${ws_address} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & + nohup ./${sdk_server_name} -openIM_ws_address ${ws_address} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_api_address ${api_address} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & #Check launched service process sleep 3 From de67b9465ad6816bf5b4781a48f1173b89409afa Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 15:42:27 +0800 Subject: [PATCH 10/25] callback add ex field and sdk server shell update --- script/sdk_svr_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh index 2f16c9834..a8e4dc362 100644 --- a/script/sdk_svr_start.sh +++ b/script/sdk_svr_start.sh @@ -24,7 +24,7 @@ fi #Waiting port recycling sleep 1 cd ${sdk_server_binary_root} - nohup ./${sdk_server_name} -openIM_ws_address ${ws_address} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_api_address ${api_address} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & + nohup ./${sdk_server_name} -openIM_ws_address ${ws_address} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_api_address ${api_address} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & #Check launched service process sleep 3 From 0941a8e0166da72e67e96aa36f3f71dd74fdd3ca Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 15:45:13 +0800 Subject: [PATCH 11/25] shell update --- script/sdk_svr_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh index a8e4dc362..0432ebbfd 100644 --- a/script/sdk_svr_start.sh +++ b/script/sdk_svr_start.sh @@ -24,7 +24,7 @@ fi #Waiting port recycling sleep 1 cd ${sdk_server_binary_root} - nohup ./${sdk_server_name} -openIM_ws_address ${ws_address} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_api_address ${api_address} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & + nohup ./${sdk_server_name} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_api_address ${api_address} -openIM_log_level ${logLevel} -openIM_ws_address ${ws_address} >>../logs/openIM.log 2>&1 & #Check launched service process sleep 3 From e172364e868d72ab748763fca10e8e36f2557b97 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 15:51:23 +0800 Subject: [PATCH 12/25] shell update --- config/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 984d8175a..88196ecbe 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -102,8 +102,8 @@ cmsapi: sdk: openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 dataDir: [ ../db/sdk/ ] - openImWsAddress: - openImApiAddress: + openImWsAddress: "ws://127.0.0.1:10001" + openImApiAddress: "http://127.0.0.1:10002" #对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器) credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改 From 059dd1993ae647a7ebf6ba09115a5255b68342b4 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 15:51:50 +0800 Subject: [PATCH 13/25] shell update --- script/sdk_svr_start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh index 0432ebbfd..a8e4dc362 100644 --- a/script/sdk_svr_start.sh +++ b/script/sdk_svr_start.sh @@ -24,7 +24,7 @@ fi #Waiting port recycling sleep 1 cd ${sdk_server_binary_root} - nohup ./${sdk_server_name} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_api_address ${api_address} -openIM_log_level ${logLevel} -openIM_ws_address ${ws_address} >>../logs/openIM.log 2>&1 & + nohup ./${sdk_server_name} -openIM_ws_address ${ws_address} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_api_address ${api_address} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & #Check launched service process sleep 3 From 4203c4d30c4dc0aee71c57b6995f58caf1959153 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 16:15:24 +0800 Subject: [PATCH 14/25] shell update --- script/sdk_svr_start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh index a8e4dc362..115ceff82 100644 --- a/script/sdk_svr_start.sh +++ b/script/sdk_svr_start.sh @@ -5,8 +5,8 @@ source ./path_info.cfg source ./function.sh ulimit -n 200000 -ws_address=$(cat $config_path | grep openImWsAddress | awk -F '[:]' '{print $NF}') -api_address=$(cat $config_path | grep openImApiAddress | awk -F '[:]' '{print $NF}') +ws_address=$(cat $config_path | grep openImWsAddress | awk -F '[ ]' '{print $NF}') +api_address=$(cat $config_path | grep openImApiAddress | awk -F '[ ]' '{print $NF}') list3=$(cat $config_path | grep openImSdkWsPort | awk -F '[:]' '{print $NF}') logLevel=$(cat $config_path | grep remainLogLevel | awk -F '[:]' '{print $NF}') list_to_string $list3 From 221b4587d42e1a6b63d3cfc38b6cc53765d73f3b Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 16:20:31 +0800 Subject: [PATCH 15/25] shell update --- config/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 88196ecbe..7236c9c32 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -102,8 +102,8 @@ cmsapi: sdk: openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 dataDir: [ ../db/sdk/ ] - openImWsAddress: "ws://127.0.0.1:10001" - openImApiAddress: "http://127.0.0.1:10002" + openImWsAddress: ws://127.0.0.1:10001 + openImApiAddress: http://127.0.0.1:10002 #对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器) credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改 From 06a75a0a0e1db00b70e00c49d90dc86a350d9f5b Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 18:12:18 +0800 Subject: [PATCH 16/25] add version --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index 7236c9c32..5fbfe7492 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -2,7 +2,7 @@ # The class cannot be named by Pascal or camel case. # If it is not used, the corresponding structure will not be set, # and it will not be read naturally. -serverversion: 2.3.0 +serverversion: 2.3.1 #---------------Infrastructure configuration---------------------# etcd: etcdSchema: openim #默认即可 From 27dd574c4ddfbd390181263492d37dadce90e9d6 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 24 Aug 2022 20:33:41 +0800 Subject: [PATCH 17/25] err log --- pkg/common/db/rocks_cache/rocks_cache.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/common/db/rocks_cache/rocks_cache.go b/pkg/common/db/rocks_cache/rocks_cache.go index a510b67a0..1957b1e87 100644 --- a/pkg/common/db/rocks_cache/rocks_cache.go +++ b/pkg/common/db/rocks_cache/rocks_cache.go @@ -382,9 +382,12 @@ func GetJoinedSuperGroupListFromCache(userID string) ([]string, error) { return string(bytes), utils.Wrap(err, "") } joinedSuperGroupListStr, err := db.DB.Rc.Fetch(joinedSuperGroupListCache+userID, time.Second*30*60, getJoinedSuperGroupIDList) + if err != nil { + return nil, err + } var joinedSuperGroupList []string err = json.Unmarshal([]byte(joinedSuperGroupListStr), &joinedSuperGroupList) - return joinedSuperGroupList, err + return joinedSuperGroupList, utils.Wrap(err, "") } func DelJoinedSuperGroupIDListFromCache(userID string) error { From 9d1eb469b50a18ada0407ec2eb78fe73cde8e3c8 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 25 Aug 2022 14:05:59 +0800 Subject: [PATCH 18/25] compose file update --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index aeac41995..115c49f9e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -126,7 +126,7 @@ services: # STORE_PORT: 3306 open_im_server: - image: openim/open_im_server:v2.3.0 + image: openim/open_im_server:v2.3.1 container_name: open_im_server volumes: - ./logs:/Open-IM-Server/logs From 96e08515633b6167c4a100eb0ba15b9448f6ef0b Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 26 Aug 2022 11:39:01 +0800 Subject: [PATCH 19/25] group file update --- internal/rpc/group/group.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index beff56072..5b5335329 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -483,11 +483,9 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) } } - go func() { - for _, v := range req.InvitedUserIDList { - chat.SuperGroupNotification(req.OperationID, v, v) - } - }() + for _, v := range req.InvitedUserIDList { + chat.SuperGroupNotification(req.OperationID, v, v) + } } log.NewInfo(req.OperationID, "InviteUserToGroup rpc return ", resp) From 93f8ed223e14c59f31ab29c75a35eccf764b98cd Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 26 Aug 2022 17:41:58 +0800 Subject: [PATCH 20/25] group file update --- internal/msg_gateway/gate/relay_rpc_server.go | 1 + internal/push/logic/push_rpc_server.go | 1 + internal/rpc/admin_cms/admin_cms.go | 2 +- internal/rpc/auth/auth.go | 3 ++- internal/rpc/cache/cache.go | 2 +- internal/rpc/conversation/conversaion.go | 2 +- internal/rpc/friend/friend.go | 2 +- internal/rpc/group/group.go | 3 ++- internal/rpc/message_cms/message_cms.go | 2 +- internal/rpc/msg/rpcChat.go | 2 +- internal/rpc/office/office.go | 2 +- internal/rpc/organization/organization.go | 2 +- internal/rpc/statistics/statistics.go | 2 +- internal/rpc/user/user.go | 2 +- 14 files changed, 16 insertions(+), 12 deletions(-) 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 { From fad61a0a2ae7a470de37d1b80dade691d339e574 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 26 Aug 2022 22:20:13 +0800 Subject: [PATCH 21/25] fix bug --- internal/rpc/msg/organization_notification.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/rpc/msg/organization_notification.go b/internal/rpc/msg/organization_notification.go index d9dd6fd52..bcdeb13e8 100644 --- a/internal/rpc/msg/organization_notification.go +++ b/internal/rpc/msg/organization_notification.go @@ -1,12 +1,14 @@ package msg import ( + "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" "Open_IM/pkg/common/log" utils2 "Open_IM/pkg/common/utils" open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" ) @@ -29,7 +31,7 @@ func OrganizationNotificationToAll(opUserID string, operationID string) { for _, v := range userIDList { log.Debug(operationID, "OrganizationNotification", opUserID, v, constant.OrganizationChangedNotification, &tips, operationID) - OrganizationNotification(opUserID, v, constant.OrganizationChangedNotification, &tips, operationID) + OrganizationNotification(config.Config.Manager.AppManagerUid[0], v, constant.OrganizationChangedNotification, &tips, operationID) } } From d598ec18525ee3d610f79f06c770f3d4b123f128 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 26 Aug 2022 23:23:42 +0800 Subject: [PATCH 22/25] fix bug --- internal/demo/register/onboarding_process.go | 4 +++- internal/demo/register/set_password.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/demo/register/onboarding_process.go b/internal/demo/register/onboarding_process.go index bac5a244c..0978b62b1 100644 --- a/internal/demo/register/onboarding_process.go +++ b/internal/demo/register/onboarding_process.go @@ -16,10 +16,11 @@ import ( "context" "errors" "fmt" - "github.com/golang/protobuf/proto" "math/rand" "strings" "time" + + "github.com/golang/protobuf/proto" ) type OnboardingProcessReq struct { @@ -75,6 +76,7 @@ func onboardingProcess(operationID, userID, userName, faceURL, phoneNumber, emai if err != nil { log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) } + log.Debug(operationID, utils.GetSelfFuncName(), "getjoinGroupIDListdepartmentID", groupIDList) joinGroups(operationID, userID, userName, faceURL, groupIDList) log.NewInfo(operationID, utils.GetSelfFuncName(), "fineshed") } diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go index 5b7deae4f..8ab61006b 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -153,7 +153,7 @@ func SetPassword(c *gin.Context) { log.Info(params.OperationID, "end setPassword", account, params.Password) // demo onboarding - if params.UserID == "" && config.Config.Demo.OnboardProcess { + if params.UserID == "" || config.Config.Demo.OnboardProcess { select { case Ch <- OnboardingProcessReq{ OperationID: params.OperationID, From 43f7ecc75a3a38d3e7fdc9a9d42fcef14ee5afe9 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sat, 27 Aug 2022 00:03:12 +0800 Subject: [PATCH 23/25] fix bug --- internal/demo/register/set_password.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go index 8ab61006b..5b7deae4f 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -153,7 +153,7 @@ func SetPassword(c *gin.Context) { log.Info(params.OperationID, "end setPassword", account, params.Password) // demo onboarding - if params.UserID == "" || config.Config.Demo.OnboardProcess { + if params.UserID == "" && config.Config.Demo.OnboardProcess { select { case Ch <- OnboardingProcessReq{ OperationID: params.OperationID, From a92c0ffac365e42a796107fd29071ea67301a158 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sat, 27 Aug 2022 00:14:53 +0800 Subject: [PATCH 24/25] fix bug --- internal/demo/register/set_password.go | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go index 5b7deae4f..214090c53 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -153,20 +153,20 @@ func SetPassword(c *gin.Context) { log.Info(params.OperationID, "end setPassword", account, params.Password) // demo onboarding - if params.UserID == "" && config.Config.Demo.OnboardProcess { - select { - case Ch <- OnboardingProcessReq{ - OperationID: params.OperationID, - UserID: userID, - NickName: params.Nickname, - FaceURL: params.FaceURL, - PhoneNumber: params.AreaCode + params.PhoneNumber, - Email: params.Email, - }: - case <-time.After(time.Second * 2): - log.NewWarn(params.OperationID, utils.GetSelfFuncName(), "to ch timeOut") - } - } + // if params.UserID == "" && config.Config.Demo.OnboardProcess { + // select { + // case Ch <- OnboardingProcessReq{ + // OperationID: params.OperationID, + // UserID: userID, + // NickName: params.Nickname, + // FaceURL: params.FaceURL, + // PhoneNumber: params.AreaCode + params.PhoneNumber, + // Email: params.Email, + // }: + // case <-time.After(time.Second * 2): + // log.NewWarn(params.OperationID, utils.GetSelfFuncName(), "to ch timeOut") + // } + // } select { case ChImportFriend <- &pbFriend.ImportFriendReq{ From 5e6e30a5b317d157cc7313c58b654f496c786969 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Sat, 27 Aug 2022 00:24:09 +0800 Subject: [PATCH 25/25] fix bug --- internal/demo/register/set_password.go | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go index 214090c53..5b7deae4f 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -153,20 +153,20 @@ func SetPassword(c *gin.Context) { log.Info(params.OperationID, "end setPassword", account, params.Password) // demo onboarding - // if params.UserID == "" && config.Config.Demo.OnboardProcess { - // select { - // case Ch <- OnboardingProcessReq{ - // OperationID: params.OperationID, - // UserID: userID, - // NickName: params.Nickname, - // FaceURL: params.FaceURL, - // PhoneNumber: params.AreaCode + params.PhoneNumber, - // Email: params.Email, - // }: - // case <-time.After(time.Second * 2): - // log.NewWarn(params.OperationID, utils.GetSelfFuncName(), "to ch timeOut") - // } - // } + if params.UserID == "" && config.Config.Demo.OnboardProcess { + select { + case Ch <- OnboardingProcessReq{ + OperationID: params.OperationID, + UserID: userID, + NickName: params.Nickname, + FaceURL: params.FaceURL, + PhoneNumber: params.AreaCode + params.PhoneNumber, + Email: params.Email, + }: + case <-time.After(time.Second * 2): + log.NewWarn(params.OperationID, utils.GetSelfFuncName(), "to ch timeOut") + } + } select { case ChImportFriend <- &pbFriend.ImportFriendReq{