concurrent consumption of messages

pull/232/head
Gordon 3 years ago
parent e12207fc73
commit 8fe929d8ab

@ -242,9 +242,9 @@ func (och *OnlineHistoryConsumerHandler) MessagesDistributionHandle() {
hashCode := getHashCode(userID) hashCode := getHashCode(userID)
channelID := hashCode % ChannelNum channelID := hashCode % ChannelNum
log.Debug(triggerID, "generate channelID", hashCode, channelID, userID) log.Debug(triggerID, "generate channelID", hashCode, channelID, userID)
go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) { //go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) {
och.chArrays[cID] <- Cmd2Value{Cmd: UserMessages, Value: MsgChannelValue{userID: userID, msgList: messages, triggerID: triggerID}} och.chArrays[channelID] <- Cmd2Value{Cmd: UserMessages, Value: MsgChannelValue{userID: userID, msgList: v, triggerID: triggerID}}
}(channelID, userID, v) //}(channelID, userID, v)
} }
} }
} }

Loading…
Cancel
Save