mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-09 03:25:59 +08:00
superGroupMaxSeq
This commit is contained in:
@@ -28,24 +28,30 @@ const (
|
||||
|
||||
///ContentType
|
||||
//UserRelated
|
||||
Text = 101
|
||||
Picture = 102
|
||||
Voice = 103
|
||||
Video = 104
|
||||
File = 105
|
||||
AtText = 106
|
||||
Merger = 107
|
||||
Card = 108
|
||||
Location = 109
|
||||
Custom = 110
|
||||
Revoke = 111
|
||||
HasReadReceipt = 112
|
||||
Typing = 113
|
||||
Quote = 114
|
||||
GroupHasReadReceipt = 116
|
||||
Common = 200
|
||||
GroupMsg = 201
|
||||
SignalMsg = 202
|
||||
Text = 101
|
||||
Picture = 102
|
||||
Voice = 103
|
||||
Video = 104
|
||||
File = 105
|
||||
AtText = 106
|
||||
Merger = 107
|
||||
Card = 108
|
||||
Location = 109
|
||||
Custom = 110
|
||||
Revoke = 111
|
||||
HasReadReceipt = 112
|
||||
Typing = 113
|
||||
Quote = 114
|
||||
GroupHasReadReceipt = 116
|
||||
AdvancedText = 117
|
||||
AdvancedRevoke = 118 //影响前者消息
|
||||
CustomMsgNotTriggerConversation = 119
|
||||
CustomMsgOnlineOnly = 120
|
||||
|
||||
Common = 200
|
||||
GroupMsg = 201
|
||||
SignalMsg = 202
|
||||
CustomNotification = 203
|
||||
|
||||
//SysRelated
|
||||
NotificationBegin = 1000
|
||||
|
||||
@@ -33,6 +33,7 @@ const (
|
||||
GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT"
|
||||
groupUserMinSeq = "GROUP_USER_MIN_SEQ:"
|
||||
groupMaxSeq = "GROUP_MAX_SEQ"
|
||||
sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG"
|
||||
)
|
||||
|
||||
func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) {
|
||||
@@ -364,3 +365,11 @@ func (d *DataBases) GetGetuiToken() (string, error) {
|
||||
result := d.RDB.Get(context.Background(), getuiToken)
|
||||
return result.String(), result.Err()
|
||||
}
|
||||
|
||||
func (d *DataBases) SetSendMsgFailedFlag(operationID string) error {
|
||||
return d.RDB.Set(context.Background(), sendMsgFailedFlag+operationID, 1, time.Hour*24).Err()
|
||||
}
|
||||
|
||||
func (d *DataBases) GetSendMsgStatus(operationID string) error {
|
||||
return d.RDB.Get(context.Background(), sendMsgFailedFlag+operationID).Err()
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package rocksCache
|
||||
import (
|
||||
"Open_IM/pkg/common/db"
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"encoding/json"
|
||||
@@ -29,6 +30,7 @@ func init() {
|
||||
fmt.Println("init to del old keys")
|
||||
for _, key := range []string{groupCache, friendRelationCache, blackListCache, userInfoCache, groupInfoCache, groupOwnerIDCache, joinedGroupListCache,
|
||||
groupMemberInfoCache, groupAllMemberInfoCache, allFriendInfoCache} {
|
||||
fName := utils.GetSelfFuncName()
|
||||
var cursor uint64
|
||||
var n int
|
||||
for {
|
||||
@@ -40,10 +42,19 @@ func init() {
|
||||
}
|
||||
n += len(keys)
|
||||
//fmt.Printf("\n %s key found %d keys: %v, current cursor %d\n", key, n, keys, cursor)
|
||||
if len(keys) > 0 {
|
||||
err = db.DB.RDB.Del(context.Background(), keys...).Err()
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
//if len(keys) > 0 {
|
||||
// err = db.DB.RDB.Del(context.Background(), keys...).Err()
|
||||
// if err != nil {
|
||||
// panic(err.Error())
|
||||
// }
|
||||
//}
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user