Skip to content

Commit

Permalink
fix one chan block
Browse files Browse the repository at this point in the history
  • Loading branch information
lymallor committed Mar 17, 2022
1 parent 88f3477 commit 1335f6a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions producers/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ func (p *Producer) Producer(m *msg.Message, opts ...ProducerOption) {
opt(p)
}
ch := m.Channel
ch.SetConfirmChan(ch.ConfirmOne(make(chan amqp.Confirmation, 1)))
ch.SetReturnChan(ch.NotifyReturn(make(chan amqp.Return, 1)))
//defer ch.Close()
if ch.GetConfirmChan() == nil {
ch.SetConfirmChan(ch.ConfirmOne(make(chan amqp.Confirmation, 1)))
ch.SetReturnChan(ch.NotifyReturn(make(chan amqp.Return, 1)))
}
exchangeNum := 0
queueNum := 0
body := string(m.Body)
Expand Down

0 comments on commit 1335f6a

Please sign in to comment.