refactor: Fix linter errors

This commit is contained in:
2025-11-04 20:04:13 +03:00
parent 2a411136b7
commit 465eb99bae
2 changed files with 18 additions and 16 deletions

View File

@@ -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)
}
}