mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 12:08:52 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
This commit is contained in:
commit
88145694ce
@ -227,6 +227,8 @@ multiloginpolicy: 1
|
||||
chatpersistencemysql: true
|
||||
#可靠性存储
|
||||
reliablestorage: false
|
||||
#消息缓存时间
|
||||
msgCacheTimeout: 60 * 60
|
||||
|
||||
#token config
|
||||
tokenpolicy:
|
||||
|
@ -218,6 +218,7 @@ type config struct {
|
||||
MultiLoginPolicy int `yaml:"multiloginpolicy"`
|
||||
ChatPersistenceMysql bool `yaml:"chatpersistencemysql"`
|
||||
ReliableStorage bool `yaml:"reliablestorage"`
|
||||
MsgCacheTimeout int `yaml:"msgCacheTimeout"`
|
||||
|
||||
TokenPolicy struct {
|
||||
AccessSecret string `yaml:"accessSecret"`
|
||||
|
@ -1,6 +1,7 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/constant"
|
||||
log2 "Open_IM/pkg/common/log"
|
||||
pbChat "Open_IM/pkg/proto/chat"
|
||||
@ -296,9 +297,10 @@ func (d *DataBases) SetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string)
|
||||
log2.NewWarn("", utils.GetSelfFuncName(), "Pb2Map failed", *msg.MsgData, uid, err.Error())
|
||||
continue
|
||||
}
|
||||
_, err = d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...)
|
||||
log2.NewDebug("", "m", m)
|
||||
_, err = d.Exec("hmset", key, redis.Args{}.Add("TIMEOUT", config.Config.MsgCacheTimeout).AddFlat(m)...)
|
||||
if err != nil {
|
||||
log2.NewWarn("", utils.GetSelfFuncName(), "redis failed", "args:", key, *msg, uid)
|
||||
log2.NewWarn("", utils.GetSelfFuncName(), "redis failed", "args:", key, *msg, uid, m)
|
||||
failedList = append(failedList, *msg)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user