1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

fix cache time.

This commit is contained in:
Mrs4s 2021-04-22 20:23:49 +08:00
parent f2de387430
commit b7a2b9bbd7
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7

View File

@ -93,11 +93,11 @@ func (c *QQClient) c2cMessageSyncProcessor(rsp *msg.GetMessageResponse, info *in
func (c *QQClient) commMsgProcessor(pMsg *msg.Message, info *incomingPacketInfo) { func (c *QQClient) commMsgProcessor(pMsg *msg.Message, info *incomingPacketInfo) {
strKey := fmt.Sprintf("%d%d%d%d", pMsg.Head.GetFromUin(), pMsg.Head.GetToUin(), pMsg.Head.GetMsgSeq(), pMsg.Head.GetMsgUid()) strKey := fmt.Sprintf("%d%d%d%d", pMsg.Head.GetFromUin(), pMsg.Head.GetToUin(), pMsg.Head.GetMsgSeq(), pMsg.Head.GetMsgUid())
if _, ok := c.msgSvcCache.GetAndUpdate(strKey, time.Minute*5); ok { if _, ok := c.msgSvcCache.GetAndUpdate(strKey, time.Hour*5); ok {
c.Debug("c2c msg %v already exists in cache. skip.", pMsg.Head.GetMsgUid()) c.Debug("c2c msg %v already exists in cache. skip.", pMsg.Head.GetMsgUid())
return return
} }
c.msgSvcCache.Add(strKey, "", time.Minute*5) c.msgSvcCache.Add(strKey, "", time.Hour*5)
if info.Params.bool("init") { if info.Params.bool("init") {
return return
} }