Skip to content

Commit

Permalink
defer added
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurav committed Jul 1, 2020
1 parent b379c35 commit eb6b99d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RMQBus.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func init() {
func (RMQ *RMQ) Rpc(topic string, msg string) interface{} {
options := RMQ.Options
ch, err := RMQ.Conn.Channel()
//defer ch.Close()
defer ch.Close()
failOnError(err, "Failed to open a channel")
q, err := ch.QueueDeclare(
"", // name
Expand Down Expand Up @@ -110,7 +110,7 @@ func (RMQ *RMQ) Rpc(topic string, msg string) interface{} {
res = json.Unmarshal([]byte(d.Body), &req)
failOnError(err, "Failed to convert body to json")
fmt.Println("reading done")
//ch.Cancel(d.ConsumerTag, true)
ch.Cancel(d.ConsumerTag, true)
break
}
}
Expand Down

0 comments on commit eb6b99d

Please sign in to comment.