mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +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())
|
log.NewError("0", utils.GetSelfFuncName(), err.Error())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if len(friendIDList) == 0 {
|
||||||
|
log.NewWarn("0", utils.GetSelfFuncName(), "friendIDList is empty")
|
||||||
|
continue
|
||||||
|
}
|
||||||
if err := db.DB.AddFriendToCache(user.UserID, friendIDList...); err != nil {
|
if err := db.DB.AddFriendToCache(user.UserID, friendIDList...); err != nil {
|
||||||
log.NewError("0", utils.GetSelfFuncName(), err.Error())
|
log.NewError("0", utils.GetSelfFuncName(), err.Error())
|
||||||
}
|
}
|
||||||
@ -159,6 +163,10 @@ func updateAllBlackListToCache(userList []db.User) error {
|
|||||||
log.NewError("", utils.GetSelfFuncName(), err.Error())
|
log.NewError("", utils.GetSelfFuncName(), err.Error())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if len(blackIDList) == 0 {
|
||||||
|
log.NewWarn("0", utils.GetSelfFuncName(), "blackIDList is empty")
|
||||||
|
continue
|
||||||
|
}
|
||||||
if err := db.DB.AddBlackUserToCache(user.UserID, blackIDList...); err != nil {
|
if err := db.DB.AddBlackUserToCache(user.UserID, blackIDList...); err != nil {
|
||||||
log.NewError("0", utils.GetSelfFuncName(), err.Error())
|
log.NewError("0", utils.GetSelfFuncName(), err.Error())
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user