diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index d2f03312f..70b9dcca4 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -106,6 +106,10 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR utils.CopyStructFields(&groupInfo, req.GroupInfo) groupInfo.CreatorUserID = req.OpUserID groupInfo.GroupID = groupId + + if groupInfo.NotificationUpdateTime.Unix() < 0 { + groupInfo.NotificationUpdateTime = utils.UnixSecondToTime(0) + } err := imdb.InsertIntoGroup(groupInfo) if err != nil { log.NewError(req.OperationID, "InsertIntoGroup failed, ", err.Error(), groupInfo) diff --git a/internal/rpc/msg/group_notification.go b/internal/rpc/msg/group_notification.go index e14bfce8d..697e51824 100644 --- a/internal/rpc/msg/group_notification.go +++ b/internal/rpc/msg/group_notification.go @@ -57,7 +57,8 @@ func setGroupInfo(groupID string, groupInfo *open_im_sdk.GroupInfo) error { } err = utils2.GroupDBCopyOpenIM(groupInfo, group) if err != nil { - return utils.Wrap(err, "GetGroupMemberNumByGroupID failed") + log.NewWarn("", "GroupDBCopyOpenIM failed ", groupID, err.Error()) + return nil } return nil } diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_model.go index edfd2087d..343d55e87 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_model.go @@ -32,9 +32,7 @@ func InsertIntoGroup(groupInfo db.Group) error { groupInfo.GroupName = "Group Chat" } groupInfo.CreateTime = time.Now() - if groupInfo.NotificationUpdateTime.Unix() < 0 { - groupInfo.NotificationUpdateTime = utils.UnixSecondToTime(0) - } + err = dbConn.Table("groups").Create(groupInfo).Error if err != nil { return err