This commit is contained in:
shoopea 2019-05-04 17:02:44 +08:00
parent 9f7e236ecd
commit 76eb120b27

4
mq.go
View File

@ -40,10 +40,10 @@ func MQGetMsg(id int, msgs chan<- ChatWarsMessage) {
failOnError(err, "MQGetMsg["+strconv.Itoa(id)+"] : Failed to register a consumer")
for d := range m {
log.Printf("MQGetMsg["+strconv.Itoa(id)+"] : Received a message: %s", d.Body)
log.Printf("MQGetMsg["+strconv.Itoa(id)+"] : Received a message: %s", string(d.Body))
if err = json.Unmarshal(d.Body, &x); err != nil {
logOnError(err, "MQGetMsg["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+d.Body)
logOnError(err, "MQGetMsg["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body))
} else {
msgs <- x
}