From af8d412d1a7d49ad748770c7cfefe1dd4022fdb5 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 12 Aug 2022 20:05:01 +0800 Subject: [PATCH] mark message --- internal/push/logic/push_handler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/push/logic/push_handler.go b/internal/push/logic/push_handler.go index 0c04a933d..e2147c3f7 100644 --- a/internal/push/logic/push_handler.go +++ b/internal/push/logic/push_handler.go @@ -13,6 +13,7 @@ import ( "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/msg" pbPush "Open_IM/pkg/proto/push" + "Open_IM/pkg/utils" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" ) @@ -43,6 +44,11 @@ func (ms *PushConsumerHandler) handleMs2PsChat(msg []byte) { MsgData: msgFromMQ.MsgData, PushToUserID: msgFromMQ.PushToUserID, } + sec := msgFromMQ.MsgData.SendTime / 1000 + nowSec := utils.GetCurrentTimestampBySecond() + if nowSec-sec > 10 { + return + } switch msgFromMQ.MsgData.SessionType { case constant.SuperGroupChatType: MsgToSuperGroupUser(pbData)