mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-02 18:34:29 +08:00
error occurs when an empty slice operated by sadd
This commit is contained in:
parent
b696984655
commit
2ac869de50
8
internal/rpc/cache/cache.go
vendored
8
internal/rpc/cache/cache.go
vendored
@ -143,6 +143,10 @@ func updateAllFriendToCache(userList []db.User) error {
|
||||
log.NewError("0", utils.GetSelfFuncName(), err.Error())
|
||||
continue
|
||||
}
|
||||
if len(friendIDList) == 0 {
|
||||
log.NewWarn("0", utils.GetSelfFuncName(), "friendIDList is empty")
|
||||
continue
|
||||
}
|
||||
if err := db.DB.AddFriendToCache(user.UserID, friendIDList...); err != nil {
|
||||
log.NewError("0", utils.GetSelfFuncName(), err.Error())
|
||||
}
|
||||
@ -159,6 +163,10 @@ func updateAllBlackListToCache(userList []db.User) error {
|
||||
log.NewError("", utils.GetSelfFuncName(), err.Error())
|
||||
continue
|
||||
}
|
||||
if len(blackIDList) == 0 {
|
||||
log.NewWarn("0", utils.GetSelfFuncName(), "blackIDList is empty")
|
||||
continue
|
||||
}
|
||||
if err := db.DB.AddBlackUserToCache(user.UserID, blackIDList...); err != nil {
|
||||
log.NewError("0", utils.GetSelfFuncName(), err.Error())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user