callback fix

pull/261/head
wangchuxiao 3 years ago
parent 3d0827a6da
commit 0f655e9292

@ -214,17 +214,18 @@ func DelGroupMemberInfoFromCache(groupID, userID string) error {
func GetGroupMembersInfoFromCache(count, offset int32, groupID string) ([]*db.GroupMember, error) {
var cursor uint64
var err error
var keys []string
var keys, currentKeys []string
key := groupMemberInfoCache + groupID + "-"
if count != 0 {
keys, cursor, err = db.DB.RDB.Scan(context.Background(), uint64(offset), key, int64(count)).Result()
if err != nil {
return nil, err
}
keys = append(keys, currentKeys...)
} else {
for {
var currentKeys []string
currentKeys, cursor, err = db.DB.RDB.Scan(context.Background(), cursor, key, 3000).Result()
currentKeys, cursor, err = db.DB.RDB.Scan(context.Background(), cursor, key, int64(count)).Result()
if err != nil {
return nil, err
}

Loading…
Cancel
Save