mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
test
This commit is contained in:
parent
eb7ff77461
commit
3bc2e97e8b
@ -103,18 +103,23 @@ func (mc *OfflineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupS
|
||||
// log.NewDebug("", "kafka get info to delay mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "offline")
|
||||
// //mc.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
||||
//}
|
||||
cmd := Cmd2Value{}
|
||||
repeat:
|
||||
select {
|
||||
case cmd := <-mc.cmdCh:
|
||||
if cmd.Cmd == OnlineTopicVacancy {
|
||||
for msg := range claim.Messages() {
|
||||
if GetOnlineTopicStatus() == OnlineTopicVacancy {
|
||||
log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value))
|
||||
mc.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
||||
sess.MarkMessage(msg, "")
|
||||
}
|
||||
case cmd = <-mc.cmdCh:
|
||||
case <-time.After(time.Millisecond * time.Duration(1)):
|
||||
goto repeat
|
||||
}
|
||||
if cmd.Cmd == OnlineTopicVacancy {
|
||||
for msg := range claim.Messages() {
|
||||
if GetOnlineTopicStatus() == OnlineTopicVacancy {
|
||||
log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value))
|
||||
mc.msgHandle[msg.Topic](msg.Value, string(msg.Key))
|
||||
sess.MarkMessage(msg, "")
|
||||
} else {
|
||||
goto repeat
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user