You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/common/db/rocks_cache/rocks_cache.go

629 lines
20 KiB

2 years ago
package rocksCache
import (
"Open_IM/pkg/common/constant"
2 years ago
"Open_IM/pkg/common/db"
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
2 years ago
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"context"
2 years ago
"encoding/json"
"fmt"
2 years ago
"math/big"
"sort"
"strconv"
2 years ago
"time"
)
const (
userInfoCache = "USER_INFO_CACHE:"
friendRelationCache = "FRIEND_RELATION_CACHE:"
blackListCache = "BLACK_LIST_CACHE:"
groupCache = "GROUP_CACHE:"
groupInfoCache = "GROUP_INFO_CACHE:"
groupOwnerIDCache = "GROUP_OWNER_ID:"
joinedGroupListCache = "JOINED_GROUP_LIST_CACHE:"
groupMemberInfoCache = "GROUP_MEMBER_INFO_CACHE:"
groupAllMemberInfoCache = "GROUP_ALL_MEMBER_INFO_CACHE:"
allFriendInfoCache = "ALL_FRIEND_INFO_CACHE:"
allDepartmentCache = "ALL_DEPARTMENT_CACHE:"
allDepartmentMemberCache = "ALL_DEPARTMENT_MEMBER_CACHE:"
joinedSuperGroupListCache = "JOINED_SUPER_GROUP_LIST_CACHE:"
2 years ago
groupMemberListHashCache = "GROUP_MEMBER_LIST_HASH_CACHE:"
groupMemberNumCache = "GROUP_MEMBER_NUM_CACHE:"
conversationCache = "CONVERSATION_CACHE:"
conversationIDListCache = "CONVERSATION_ID_LIST_CACHE:"
2 years ago
extendMsgSetCache = "EXTEND_MSG_SET_CACHE:"
extendMsgCache = "EXTEND_MSG_CACHE:"
2 years ago
)
2 years ago
func DelKeys() {
fmt.Println("init to del old keys")
for _, key := range []string{groupCache, friendRelationCache, blackListCache, userInfoCache, groupInfoCache, groupOwnerIDCache, joinedGroupListCache,
2 years ago
groupMemberInfoCache, groupAllMemberInfoCache, allFriendInfoCache} {
2 years ago
fName := utils.GetSelfFuncName()
var cursor uint64
var n int
for {
var keys []string
var err error
keys, cursor, err = db.DB.RDB.Scan(context.Background(), cursor, key+"*", 3000).Result()
if err != nil {
panic(err.Error())
}
n += len(keys)
// for each for redis cluster
2 years ago
for _, key := range keys {
if err = db.DB.RDB.Del(context.Background(), key).Err(); err != nil {
log.NewError("", fName, key, err.Error())
err = db.DB.RDB.Del(context.Background(), key).Err()
if err != nil {
panic(err.Error())
}
}
}
if cursor == 0 {
break
}
}
}
}
2 years ago
func GetFriendIDListFromCache(userID string) ([]string, error) {
getFriendIDList := func() (string, error) {
friendIDList, err := imdb.GetFriendIDListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(friendIDList)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
friendIDListStr, err := db.DB.Rc.Fetch(friendRelationCache+userID, time.Second*30*60, getFriendIDList)
if err != nil {
return nil, utils.Wrap(err, "")
}
var friendIDList []string
2 years ago
err = json.Unmarshal([]byte(friendIDListStr), &friendIDList)
return friendIDList, utils.Wrap(err, "")
2 years ago
}
func DelFriendIDListFromCache(userID string) error {
err := db.DB.Rc.TagAsDeleted(friendRelationCache + userID)
return err
}
func GetBlackListFromCache(userID string) ([]string, error) {
getBlackIDList := func() (string, error) {
blackIDList, err := imdb.GetBlackIDListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(blackIDList)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
blackIDListStr, err := db.DB.Rc.Fetch(blackListCache+userID, time.Second*30*60, getBlackIDList)
if err != nil {
return nil, utils.Wrap(err, "")
}
var blackIDList []string
2 years ago
err = json.Unmarshal([]byte(blackIDListStr), &blackIDList)
return blackIDList, utils.Wrap(err, "")
2 years ago
}
func DelBlackIDListFromCache(userID string) error {
return db.DB.Rc.TagAsDeleted(blackListCache + userID)
}
func GetJoinedGroupIDListFromCache(userID string) ([]string, error) {
getJoinedGroupIDList := func() (string, error) {
joinedGroupList, err := imdb.GetJoinedGroupIDListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(joinedGroupList)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
joinedGroupIDListStr, err := db.DB.Rc.Fetch(joinedGroupListCache+userID, time.Second*30*60, getJoinedGroupIDList)
if err != nil {
return nil, utils.Wrap(err, "")
}
var joinedGroupList []string
2 years ago
err = json.Unmarshal([]byte(joinedGroupIDListStr), &joinedGroupList)
return joinedGroupList, utils.Wrap(err, "")
2 years ago
}
func DelJoinedGroupIDListFromCache(userID string) error {
return db.DB.Rc.TagAsDeleted(joinedGroupListCache + userID)
}
func GetGroupMemberIDListFromCache(groupID string) ([]string, error) {
f := func() (string, error) {
groupInfo, err := GetGroupInfoFromCache(groupID)
if err != nil {
return "", utils.Wrap(err, "GetGroupInfoFromCache failed")
}
var groupMemberIDList []string
if groupInfo.GroupType == constant.SuperGroup {
superGroup, err := db.DB.GetSuperGroup(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
groupMemberIDList = superGroup.MemberIDList
} else {
groupMemberIDList, err = imdb.GetGroupMemberIDListByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
}
bytes, err := json.Marshal(groupMemberIDList)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
groupIDListStr, err := db.DB.Rc.Fetch(groupCache+groupID, time.Second*30*60, f)
if err != nil {
return nil, utils.Wrap(err, "")
}
var groupMemberIDList []string
2 years ago
err = json.Unmarshal([]byte(groupIDListStr), &groupMemberIDList)
return groupMemberIDList, utils.Wrap(err, "")
2 years ago
}
func DelGroupMemberIDListFromCache(groupID string) error {
err := db.DB.Rc.TagAsDeleted(groupCache + groupID)
2 years ago
return err
}
func GetUserInfoFromCache(userID string) (*db.User, error) {
getUserInfo := func() (string, error) {
userInfo, err := imdb.GetUserByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
2 years ago
}
bytes, err := json.Marshal(userInfo)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
userInfoStr, err := db.DB.Rc.Fetch(userInfoCache+userID, time.Second*30*60, getUserInfo)
2 years ago
if err != nil {
return nil, utils.Wrap(err, "")
2 years ago
}
userInfo := &db.User{}
err = json.Unmarshal([]byte(userInfoStr), userInfo)
return userInfo, utils.Wrap(err, "")
2 years ago
}
func DelUserInfoFromCache(userID string) error {
return db.DB.Rc.TagAsDeleted(userInfoCache + userID)
}
2 years ago
func GetGroupMemberInfoFromCache(groupID, userID string) (*db.GroupMember, error) {
2 years ago
getGroupMemberInfo := func() (string, error) {
groupMemberInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID)
if err != nil {
return "", utils.Wrap(err, "")
2 years ago
}
bytes, err := json.Marshal(groupMemberInfo)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
2 years ago
groupMemberInfoStr, err := db.DB.Rc.Fetch(groupMemberInfoCache+groupID+"-"+userID, time.Second*30*60, getGroupMemberInfo)
2 years ago
if err != nil {
return nil, utils.Wrap(err, "")
2 years ago
}
groupMember := &db.GroupMember{}
err = json.Unmarshal([]byte(groupMemberInfoStr), groupMember)
return groupMember, utils.Wrap(err, "")
2 years ago
}
func DelGroupMemberInfoFromCache(groupID, userID string) error {
return db.DB.Rc.TagAsDeleted(groupMemberInfoCache + groupID + "-" + userID)
}
2 years ago
func GetGroupMembersInfoFromCache(count, offset int32, groupID string) ([]*db.GroupMember, error) {
2 years ago
groupMemberIDList, err := GetGroupMemberIDListFromCache(groupID)
if err != nil {
return nil, err
}
if count < 0 || offset < 0 {
return nil, nil
}
var groupMemberList []*db.GroupMember
2 years ago
var start, stop int32
start = offset
stop = offset + count
l := int32(len(groupMemberIDList))
if start > stop {
return nil, nil
}
if start >= l {
return nil, nil
}
2 years ago
if count != 0 {
2 years ago
if stop >= l {
stop = l
}
groupMemberIDList = groupMemberIDList[start:stop]
2 years ago
} else {
if l < 1000 {
stop = l
} else {
stop = 1000
}
groupMemberIDList = groupMemberIDList[start:stop]
2 years ago
}
2 years ago
//log.NewDebug("", utils.GetSelfFuncName(), "ID list: ", groupMemberIDList)
2 years ago
for _, userID := range groupMemberIDList {
groupMembers, err := GetGroupMemberInfoFromCache(groupID, userID)
2 years ago
if err != nil {
2 years ago
log.NewError("", utils.GetSelfFuncName(), err.Error(), groupID, userID)
2 years ago
continue
2 years ago
}
2 years ago
groupMemberList = append(groupMemberList, groupMembers)
2 years ago
}
return groupMemberList, nil
}
2 years ago
func GetAllGroupMembersInfoFromCache(groupID string) ([]*db.GroupMember, error) {
getGroupMemberInfo := func() (string, error) {
groupMembers, err := imdb.GetGroupMemberListByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
2 years ago
}
bytes, err := json.Marshal(groupMembers)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
groupMembersStr, err := db.DB.Rc.Fetch(groupAllMemberInfoCache+groupID, time.Second*30*60, getGroupMemberInfo)
2 years ago
if err != nil {
return nil, utils.Wrap(err, "")
2 years ago
}
var groupMembers []*db.GroupMember
err = json.Unmarshal([]byte(groupMembersStr), &groupMembers)
return groupMembers, utils.Wrap(err, "")
2 years ago
}
func DelAllGroupMembersInfoFromCache(groupID string) error {
return db.DB.Rc.TagAsDeleted(groupAllMemberInfoCache + groupID)
}
func GetGroupInfoFromCache(groupID string) (*db.Group, error) {
getGroupInfo := func() (string, error) {
groupInfo, err := imdb.GetGroupInfoByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
2 years ago
}
bytes, err := json.Marshal(groupInfo)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
groupInfoStr, err := db.DB.Rc.Fetch(groupInfoCache+groupID, time.Second*30*60, getGroupInfo)
2 years ago
if err != nil {
return nil, utils.Wrap(err, "")
2 years ago
}
groupInfo := &db.Group{}
err = json.Unmarshal([]byte(groupInfoStr), groupInfo)
return groupInfo, utils.Wrap(err, "")
2 years ago
}
func DelGroupInfoFromCache(groupID string) error {
return db.DB.Rc.TagAsDeleted(groupInfoCache + groupID)
}
func GetAllFriendsInfoFromCache(userID string) ([]*db.Friend, error) {
getAllFriendInfo := func() (string, error) {
friendInfoList, err := imdb.GetFriendListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
2 years ago
}
bytes, err := json.Marshal(friendInfoList)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
allFriendInfoStr, err := db.DB.Rc.Fetch(allFriendInfoCache+userID, time.Second*30*60, getAllFriendInfo)
2 years ago
if err != nil {
return nil, utils.Wrap(err, "")
2 years ago
}
var friendInfoList []*db.Friend
err = json.Unmarshal([]byte(allFriendInfoStr), &friendInfoList)
return friendInfoList, utils.Wrap(err, "")
2 years ago
}
func DelAllFriendsInfoFromCache(userID string) error {
return db.DB.Rc.TagAsDeleted(allFriendInfoCache + userID)
}
2 years ago
func GetAllDepartmentsFromCache() ([]db.Department, error) {
2 years ago
getAllDepartments := func() (string, error) {
departmentList, err := imdb.GetSubDepartmentList("-1")
if err != nil {
return "", utils.Wrap(err, "")
2 years ago
}
bytes, err := json.Marshal(departmentList)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
allDepartmentsStr, err := db.DB.Rc.Fetch(allDepartmentCache, time.Second*30*60, getAllDepartments)
2 years ago
if err != nil {
return nil, utils.Wrap(err, "")
2 years ago
}
2 years ago
var allDepartments []db.Department
2 years ago
err = json.Unmarshal([]byte(allDepartmentsStr), &allDepartments)
return allDepartments, utils.Wrap(err, "")
2 years ago
}
func DelAllDepartmentsFromCache() error {
return db.DB.Rc.TagAsDeleted(allDepartmentCache)
}
2 years ago
func GetAllDepartmentMembersFromCache() ([]db.DepartmentMember, error) {
2 years ago
getAllDepartmentMembers := func() (string, error) {
departmentMembers, err := imdb.GetDepartmentMemberList("-1")
if err != nil {
return "", utils.Wrap(err, "")
2 years ago
}
bytes, err := json.Marshal(departmentMembers)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
2 years ago
}
allDepartmentMembersStr, err := db.DB.Rc.Fetch(allDepartmentMemberCache, time.Second*30*60, getAllDepartmentMembers)
2 years ago
if err != nil {
return nil, utils.Wrap(err, "")
2 years ago
}
2 years ago
var allDepartmentMembers []db.DepartmentMember
2 years ago
err = json.Unmarshal([]byte(allDepartmentMembersStr), &allDepartmentMembers)
return allDepartmentMembers, utils.Wrap(err, "")
2 years ago
}
func DelAllDepartmentMembersFromCache() error {
return db.DB.Rc.TagAsDeleted(allDepartmentMemberCache)
}
func GetJoinedSuperGroupListFromCache(userID string) ([]string, error) {
getJoinedSuperGroupIDList := func() (string, error) {
userToSuperGroup, err := db.DB.GetSuperGroupByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(userToSuperGroup.GroupIDList)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
2 years ago
joinedSuperGroupListStr, err := db.DB.Rc.Fetch(joinedSuperGroupListCache+userID, time.Second*30*60, getJoinedSuperGroupIDList)
2 years ago
if err != nil {
return nil, err
}
var joinedSuperGroupList []string
err = json.Unmarshal([]byte(joinedSuperGroupListStr), &joinedSuperGroupList)
2 years ago
return joinedSuperGroupList, utils.Wrap(err, "")
}
func DelJoinedSuperGroupIDListFromCache(userID string) error {
err := db.DB.Rc.TagAsDeleted(joinedSuperGroupListCache + userID)
return err
}
2 years ago
func GetGroupMemberListHashFromCache(groupID string) (uint64, error) {
generateHash := func() (string, error) {
2 years ago
groupInfo, err := GetGroupInfoFromCache(groupID)
if err != nil {
return "0", utils.Wrap(err, "GetGroupInfoFromCache failed")
}
if groupInfo.Status == constant.GroupStatusDismissed {
return "0", nil
}
2 years ago
groupMemberIDList, err := GetGroupMemberIDListFromCache(groupID)
if err != nil {
2 years ago
return "", utils.Wrap(err, "GetGroupMemberIDListFromCache failed")
2 years ago
}
sort.Strings(groupMemberIDList)
var all string
for _, v := range groupMemberIDList {
all += v
}
bi := big.NewInt(0)
2 years ago
bi.SetString(utils.Md5(all)[0:8], 16)
2 years ago
return strconv.Itoa(int(bi.Uint64())), nil
}
hashCode, err := db.DB.Rc.Fetch(groupMemberListHashCache+groupID, time.Second*30*60, generateHash)
2 years ago
if err != nil {
return 0, utils.Wrap(err, "fetch failed")
}
2 years ago
hashCodeUint64, err := strconv.Atoi(hashCode)
return uint64(hashCodeUint64), err
}
func DelGroupMemberListHashFromCache(groupID string) error {
err := db.DB.Rc.TagAsDeleted(groupMemberListHashCache + groupID)
return err
}
func GetGroupMemberNumFromCache(groupID string) (int64, error) {
getGroupMemberNum := func() (string, error) {
num, err := imdb.GetGroupMemberNumByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
return strconv.Itoa(int(num)), nil
}
groupMember, err := db.DB.Rc.Fetch(groupMemberNumCache+groupID, time.Second*30*60, getGroupMemberNum)
2 years ago
if err != nil {
return 0, utils.Wrap(err, "")
}
2 years ago
num, err := strconv.Atoi(groupMember)
return int64(num), err
}
2 years ago
func DelGroupMemberNumFromCache(groupID string) error {
return db.DB.Rc.TagAsDeleted(groupMemberNumCache + groupID)
}
func GetUserConversationIDListFromCache(userID string) ([]string, error) {
getConversationIDList := func() (string, error) {
conversationIDList, err := imdb.GetConversationIDListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "getConversationIDList failed")
}
2 years ago
log.NewDebug("", utils.GetSelfFuncName(), conversationIDList)
bytes, err := json.Marshal(conversationIDList)
2 years ago
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
conversationIDListStr, err := db.DB.Rc.Fetch(conversationIDListCache+userID, time.Second*30*60, getConversationIDList)
var conversationIDList []string
err = json.Unmarshal([]byte(conversationIDListStr), &conversationIDList)
if err != nil {
2 years ago
return nil, utils.Wrap(err, "")
}
return conversationIDList, nil
}
func DelUserConversationIDListFromCache(userID string) error {
return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationIDListCache+userID), "DelUserConversationIDListFromCache err")
}
func GetConversationFromCache(ownerUserID, conversationID string) (*db.Conversation, error) {
getConversation := func() (string, error) {
conversation, err := imdb.GetConversation(ownerUserID, conversationID)
if err != nil {
2 years ago
return "", utils.Wrap(err, "get failed")
}
bytes, err := json.Marshal(conversation)
2 years ago
if err != nil {
return "", utils.Wrap(err, "Marshal failed")
}
return string(bytes), nil
}
conversationStr, err := db.DB.Rc.Fetch(conversationCache+ownerUserID+":"+conversationID, time.Second*30*60, getConversation)
2 years ago
if err != nil {
return nil, utils.Wrap(err, "Fetch failed")
}
conversation := db.Conversation{}
err = json.Unmarshal([]byte(conversationStr), &conversation)
if err != nil {
2 years ago
return nil, utils.Wrap(err, "Unmarshal failed")
}
return &conversation, nil
}
func GetConversationsFromCache(ownerUserID string, conversationIDList []string) ([]db.Conversation, error) {
var conversationList []db.Conversation
for _, conversationID := range conversationIDList {
conversation, err := GetConversationFromCache(ownerUserID, conversationID)
if err != nil {
return nil, utils.Wrap(err, "GetConversationFromCache failed")
}
conversationList = append(conversationList, *conversation)
}
return conversationList, nil
}
func GetUserAllConversationList(ownerUserID string) ([]db.Conversation, error) {
IDList, err := GetUserConversationIDListFromCache(ownerUserID)
if err != nil {
return nil, err
}
var conversationList []db.Conversation
2 years ago
log.NewDebug("", utils.GetSelfFuncName(), IDList)
for _, conversationID := range IDList {
conversation, err := GetConversationFromCache(ownerUserID, conversationID)
if err != nil {
return nil, utils.Wrap(err, "GetConversationFromCache failed")
}
conversationList = append(conversationList, *conversation)
}
return conversationList, nil
}
func DelConversationFromCache(ownerUserID, conversationID string) error {
return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationCache+ownerUserID+":"+conversationID), "DelConversationFromCache err")
}
2 years ago
func GetExtendMsgSetFromCache(ID string, index int32) (*db.ExtendMsgSet, error) {
getExtendMsgSet := func() (string, error) {
extendMsgSet, err := db.DB.GetExtendMsgSet(ID, index, &db.GetExtendMsgSetOpts{IncludeExtendMsgs: false})
if err != nil {
return "", utils.Wrap(err, "GetExtendMsgSet failed")
}
bytes, err := json.Marshal(extendMsgSet)
if err != nil {
return "", utils.Wrap(err, "Marshal failed")
}
return string(bytes), nil
}
extendMsgSetStr, err := db.DB.Rc.Fetch(extendMsgSetCache+db.GetExtendMsgSetID(ID, index), time.Second*30*60, getExtendMsgSet)
if err != nil {
return nil, utils.Wrap(err, "Fetch failed")
}
extendMsgSet := &db.ExtendMsgSet{}
err = json.Unmarshal([]byte(extendMsgSetStr), extendMsgSet)
if err != nil {
return nil, utils.Wrap(err, "Unmarshal failed")
}
return extendMsgSet, nil
}
func DelExtendMsgSetFromCache(ID string, index int32) error {
return utils.Wrap(db.DB.Rc.TagAsDeleted(extendMsgSetCache+db.GetExtendMsgSetID(ID, index)), "DelExtendMsgSetFromCache err")
}
func GetExtendMsg(ID string, index, extendMsgIndex int32) (*db.ExtendMsg, error) {
getExtendMsg := func() (string, error) {
extendMsg, err := db.DB.GetExtendMsgList(ID, index, extendMsgIndex, extendMsgIndex+1)
if err != nil {
return "", utils.Wrap(err, "GetExtendMsgList failed")
}
if len(extendMsg) == 0 {
return "", nil
}
bytes, err := json.Marshal(extendMsg[0])
if err != nil {
return "", utils.Wrap(err, "Marshal failed")
}
return string(bytes), nil
}
extendMsgStr, err := db.DB.Rc.Fetch(extendMsgCache+db.GetExtendMsgSetID(ID, index)+":"+strconv.Itoa(int(extendMsgIndex)), time.Second*30*60, getExtendMsg)
if err != nil {
return nil, utils.Wrap(err, "Fetch failed")
}
extendMsg := &db.ExtendMsg{}
err = json.Unmarshal([]byte(extendMsgStr), extendMsg)
if err != nil {
return nil, utils.Wrap(err, "Unmarshal failed")
}
return extendMsg, nil
}
func DelExtendMsg(ID string, index, extendMsgIndex int32) error {
return utils.Wrap(db.DB.Rc.TagAsDeleted(extendMsgCache+db.GetExtendMsgSetID(ID, index)+":"+strconv.Itoa(int(extendMsgIndex))), "DelExtendMsg err")
}