direction channel

This commit is contained in:
shoopea 2019-05-15 10:35:51 +08:00
parent 02ad65b1f2
commit b1a33e277b

2
mq.go
View File

@ -51,7 +51,7 @@ func MQSendMsgWorker(id int, msgs <-chan ChatWarsMessage) {
}
func MQReceiveMsgWorker(id int, cmd <-chan ChatWarsCommand) {
func MQReceiveMsgWorker(id int, cmd chan<- ChatWarsCommand) {
conn, err := amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + cfg.Rabbit.ReceiveQueue)
failOnError(err, "MQReceiveMsgWorker["+strconv.Itoa(id)+"] : Failed to connect to RabbitMQ")
defer conn.Close()