mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
conversation fix
This commit is contained in:
parent
782ad07940
commit
7d04f06f7d
@ -336,6 +336,10 @@ func ManagementBatchSendMsg(c *gin.Context) {
|
||||
var recvList []string
|
||||
if params.IsSendAll {
|
||||
recvList, err = im_mysql_model.SelectAllUserID()
|
||||
if err != nil {
|
||||
log.NewError(params.OperationID, utils.GetSelfFuncName(), err.Error())
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
|
||||
}
|
||||
} else {
|
||||
recvList = params.RecvIDList
|
||||
}
|
||||
|
@ -460,16 +460,16 @@ func GetConversationFromCache(ownerUserID, conversationID string) (*db.Conversat
|
||||
getConversation := func() (string, error) {
|
||||
conversation, err := imdb.GetConversation(ownerUserID, conversationID)
|
||||
if err != nil {
|
||||
return "", utils.Wrap(err, "")
|
||||
return "", utils.Wrap(err, "get failed")
|
||||
}
|
||||
bytes, err := json.Marshal(conversation)
|
||||
return string(bytes), utils.Wrap(err, "")
|
||||
return string(bytes), utils.Wrap(err, "Marshal failed")
|
||||
}
|
||||
conversationStr, err := db.DB.Rc.Fetch(conversationCache+ownerUserID+":"+conversationID, time.Second*30*60, getConversation)
|
||||
conversation := db.Conversation{}
|
||||
err = json.Unmarshal([]byte(conversationStr), &conversation)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, utils.Wrap(err, "Unmarshal failed")
|
||||
}
|
||||
return &conversation, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user