refactor: Fix linter errors
This commit is contained in:
@@ -75,25 +75,21 @@ func (c *Connection) listenCloseNotify() {
|
||||
))
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-c.closeNotify:
|
||||
c.logger.Info("Trying to reconnect to rabbit")
|
||||
<-c.closeNotify
|
||||
c.logger.Info("Trying to reconnect to rabbit")
|
||||
|
||||
dial, dialErr := amqp.Dial(c.connString)
|
||||
if dialErr != nil {
|
||||
c.logger.Error("Error during reconnect try - ", dialErr)
|
||||
dial, dialErr := amqp.Dial(c.connString)
|
||||
if dialErr != nil {
|
||||
c.logger.Error("Error during reconnect try - ", dialErr)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
c.conn = dial
|
||||
c.closeNotify = dial.NotifyClose(make(chan *amqp.Error))
|
||||
|
||||
c.logger.Info("Rabbit connection stabilized")
|
||||
|
||||
break
|
||||
continue
|
||||
}
|
||||
|
||||
c.conn = dial
|
||||
c.closeNotify = dial.NotifyClose(make(chan *amqp.Error))
|
||||
|
||||
c.logger.Info("Rabbit connection stabilized")
|
||||
|
||||
time.Sleep(c.reconnectInterval)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user