mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-08 19:16:35 +08:00
superGroupMaxSeq
This commit is contained in:
@@ -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