This commit is contained in:
shoopea 2019-05-03 15:46:33 +08:00
parent 477fad6086
commit 6621887364

2
mq.go
View File

@ -43,11 +43,13 @@ func MQMainReceive() {
go func() { go func() {
for d := range msgs { for d := range msgs {
log.Printf("MQMainReceive : Received a message: %s", d.Body) log.Printf("MQMainReceive : Received a message: %s", d.Body)
if err = json.Unmarshal(d.Body, &m); err != nil { if err = json.Unmarshal(d.Body, &m); err != nil {
logOnError(err, "MQMainReceive : Can't unmarshal") logOnError(err, "MQMainReceive : Can't unmarshal")
} else { } else {
putMsg(m) putMsg(m)
} }
}
}() }()
<-forever <-forever