mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-01 07:35:58 +08:00
feat: ver3 branch
Signed-off-by: kubbot & kubecub <3293172751ysy@gmail.com>
This commit is contained in:
@@ -87,7 +87,7 @@ func (c *conversationDatabase) SetUsersConversationFiledTx(ctx context.Context,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
cache = cache.DelConversationIDs(NotUserIDs...).DelUserConversationIDsHash(NotUserIDs...)
|
||||
cache = cache.DelConversationIDs(NotUserIDs...).DelUserConversationIDsHash(NotUserIDs...).DelConvsersations(conversation.ConversationID, NotUserIDs...)
|
||||
}
|
||||
return nil
|
||||
}); err != nil {
|
||||
@@ -171,6 +171,7 @@ func (c *conversationDatabase) SetUserConversations(ctx context.Context, ownerUs
|
||||
var conversationIDs []string
|
||||
for _, conversation := range conversations {
|
||||
conversationIDs = append(conversationIDs, conversation.ConversationID)
|
||||
cache = cache.DelConvsersations(conversation.OwnerUserID, conversation.ConversationID)
|
||||
}
|
||||
conversationTx := c.conversationDB.NewTx(tx)
|
||||
existConversations, err := conversationTx.Find(ctx, ownerUserID, conversationIDs)
|
||||
@@ -203,7 +204,6 @@ func (c *conversationDatabase) SetUserConversations(ctx context.Context, ownerUs
|
||||
}
|
||||
cache = cache.DelConversationIDs(ownerUserID).DelUserConversationIDsHash(ownerUserID)
|
||||
}
|
||||
cache = cache.DelConvsersations(ownerUserID, existConversationIDs...)
|
||||
return nil
|
||||
}); err != nil {
|
||||
return err
|
||||
@@ -228,6 +228,7 @@ func (c *conversationDatabase) CreateGroupChatConversation(ctx context.Context,
|
||||
for _, v := range notExistUserIDs {
|
||||
conversation := relationTb.ConversationModel{ConversationType: constant.SuperGroupChatType, GroupID: groupID, OwnerUserID: v, ConversationID: conversationID}
|
||||
conversations = append(conversations, &conversation)
|
||||
cache = cache.DelConvsersations(v, conversationID)
|
||||
}
|
||||
cache = cache.DelConversationIDs(notExistUserIDs...).DelUserConversationIDsHash(notExistUserIDs...)
|
||||
if len(conversations) > 0 {
|
||||
|
||||
@@ -19,9 +19,9 @@ import (
|
||||
|
||||
func Test_BatchInsertChat2DB(t *testing.T) {
|
||||
config.Config.Mongo.Address = []string{"192.168.44.128:37017"}
|
||||
config.Config.Mongo.Timeout = 60
|
||||
// config.Config.Mongo.Timeout = 60
|
||||
config.Config.Mongo.Database = "openIM"
|
||||
config.Config.Mongo.Source = "admin"
|
||||
// config.Config.Mongo.Source = "admin"
|
||||
config.Config.Mongo.Username = "root"
|
||||
config.Config.Mongo.Password = "openIM123"
|
||||
config.Config.Mongo.MaxPoolSize = 100
|
||||
@@ -130,9 +130,9 @@ func Test_BatchInsertChat2DB(t *testing.T) {
|
||||
|
||||
func GetDB() *commonMsgDatabase {
|
||||
config.Config.Mongo.Address = []string{"192.168.44.128:37017"}
|
||||
config.Config.Mongo.Timeout = 60
|
||||
// config.Config.Mongo.Timeout = 60
|
||||
config.Config.Mongo.Database = "openIM"
|
||||
config.Config.Mongo.Source = "admin"
|
||||
// config.Config.Mongo.Source = "admin"
|
||||
config.Config.Mongo.Username = "root"
|
||||
config.Config.Mongo.Password = "openIM123"
|
||||
config.Config.Mongo.MaxPoolSize = 100
|
||||
|
||||
@@ -105,7 +105,6 @@ func (c *s3Database) urlName(name string) string {
|
||||
Host: c.url.Host,
|
||||
Path: c.url.Path,
|
||||
RawPath: c.url.RawPath,
|
||||
OmitHost: c.url.OmitHost,
|
||||
ForceQuery: c.url.ForceQuery,
|
||||
RawQuery: c.url.RawQuery,
|
||||
Fragment: c.url.Fragment,
|
||||
|
||||
Reference in New Issue
Block a user