mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-16 17:09:17 +08:00
log
This commit is contained in:
parent
67cfdedcc4
commit
6f79e63b3f
@ -378,18 +378,21 @@ func (och *OnlineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupS
|
||||
cMsg := make([]*sarama.ConsumerMessage, 500)
|
||||
t := time.NewTicker(time.Duration(500) * time.Millisecond)
|
||||
for msg := range claim.Messages() {
|
||||
operationID := utils.OperationIDGenerator()
|
||||
//och.TriggerCmd(OnlineTopicBusy)
|
||||
cMsg = append(cMsg, msg)
|
||||
select {
|
||||
case <-t.C:
|
||||
if len(cMsg) >= 0 {
|
||||
och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: cMsg}
|
||||
log.Debug(operationID, "timer send to msgDistributionCh", och.msgDistributionCh, "len: ", len(cMsg))
|
||||
sess.MarkMessage(msg, "")
|
||||
cMsg = cMsg[0:0]
|
||||
}
|
||||
default:
|
||||
if len(cMsg) >= 500 {
|
||||
och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: cMsg}
|
||||
log.Debug(operationID, "500 send to msgDistributionCh", och.msgDistributionCh, "len: ", len(cMsg))
|
||||
sess.MarkMessage(msg, "")
|
||||
cMsg = cMsg[0:0]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user