mirror of
https://github.com/eventials/goevents.git
synced 2025-04-24 13:48:53 +08:00
Remove useless code
This commit is contained in:
parent
8231c14ac1
commit
bf9ff86a03
@ -30,7 +30,6 @@ type producer struct {
|
||||
channel *amqplib.Channel
|
||||
notifyConfirm chan amqplib.Confirmation
|
||||
notifyChanClose chan *amqplib.Error
|
||||
closeQueue chan bool
|
||||
config ProducerConfig
|
||||
|
||||
internalQueue chan message
|
||||
@ -62,7 +61,6 @@ func NewProducerConfig(c messaging.Connection, exchange string, config ProducerC
|
||||
config: config,
|
||||
internalQueue: make(chan message, 2),
|
||||
exchangeName: exchange,
|
||||
closeQueue: make(chan bool),
|
||||
}
|
||||
|
||||
err := producer.setupTopology()
|
||||
@ -127,10 +125,7 @@ func (p *producer) Close() {
|
||||
|
||||
p.wg.Wait()
|
||||
|
||||
p.closeQueue <- true
|
||||
|
||||
close(p.internalQueue)
|
||||
close(p.closeQueue)
|
||||
|
||||
p.channel.Close()
|
||||
|
||||
@ -333,11 +328,7 @@ func (p *producer) isClosed() bool {
|
||||
}
|
||||
|
||||
func (p *producer) drainInternalQueue() {
|
||||
for {
|
||||
select {
|
||||
case <-p.closeQueue:
|
||||
return
|
||||
case m := <-p.internalQueue:
|
||||
for m := range p.internalQueue {
|
||||
retry := true
|
||||
|
||||
for retry {
|
||||
@ -362,4 +353,3 @@ func (p *producer) drainInternalQueue() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user