mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 02:16:16 +08:00
redis replace go redis
This commit is contained in:
parent
122a3ab4ce
commit
1257e96d5e
@ -32,13 +32,13 @@ func (d *DataBases) NewSetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid stri
|
|||||||
log2.NewDebug(operationID, "convert map is ", s)
|
log2.NewDebug(operationID, "convert map is ", s)
|
||||||
val, err := d.rdb.HMSet(ctx, key, s).Result()
|
val, err := d.rdb.HMSet(ctx, key, s).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key, *msg, uid, s, val)
|
log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key, *msg, uid, s, val, err.Error())
|
||||||
failedList = append(failedList, *msg)
|
failedList = append(failedList, *msg)
|
||||||
}
|
}
|
||||||
d.rdb.Expire(ctx, key, time.Second*time.Duration(config.Config.MsgCacheTimeout))
|
d.rdb.Expire(ctx, key, time.Second*time.Duration(config.Config.MsgCacheTimeout))
|
||||||
}
|
}
|
||||||
if len(failedList) != 0 {
|
if len(failedList) != 0 {
|
||||||
return errors.New(fmt.Sprintf("set msg to cache failed, failed lists: %q", failedList))
|
return errors.New(fmt.Sprintf("set msg to cache failed, failed lists: %q,%s", failedList, operationID))
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user