mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 03:26:57 +08:00
singal offline push
This commit is contained in:
parent
e428e186f0
commit
78dfba8771
@ -106,6 +106,13 @@ func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID str
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *DataBases) NewCacheSignalInfo(msg *pbCommon.MsgData) error {
|
func (d *DataBases) NewCacheSignalInfo(msg *pbCommon.MsgData) error {
|
||||||
|
req := &pbRtc.SignalReq{}
|
||||||
|
if err := proto.Unmarshal(msg.Content, req); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
//log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "SignalReq: ", req.String())
|
||||||
|
switch req.Payload.(type) {
|
||||||
|
case *pbRtc.SignalReq_Invite, *pbRtc.SignalReq_InviteInGroup:
|
||||||
keyList := SignalListCache + msg.RecvID
|
keyList := SignalListCache + msg.RecvID
|
||||||
timeout, err := strconv.Atoi(config.Config.Rtc.SignalTimeout)
|
timeout, err := strconv.Atoi(config.Config.Rtc.SignalTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -124,11 +131,9 @@ func (d *DataBases) NewCacheSignalInfo(msg *pbCommon.MsgData) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = d.rdb.Expire(context.Background(), key, time.Duration(timeout)*time.Second).Err()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DataBases) GetSignalInfoFromCacheByClientMsgID(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) {
|
func (d *DataBases) GetSignalInfoFromCacheByClientMsgID(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) {
|
||||||
|
@ -33,7 +33,7 @@ const (
|
|||||||
groupCache = "GROUP_CACHE:"
|
groupCache = "GROUP_CACHE:"
|
||||||
messageCache = "MESSAGE_CACHE:"
|
messageCache = "MESSAGE_CACHE:"
|
||||||
SignalCache = "SIGNAL_CACHE:"
|
SignalCache = "SIGNAL_CACHE:"
|
||||||
SignalListCache = "SIGNAL_ZSET_CACHE:"
|
SignalListCache = "SIGNAL_LIST_CACHE:"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) {
|
func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user