Skip to content
Snippets Groups Projects
Commit 5889413a authored by Neil-Jocelyn Schark's avatar Neil-Jocelyn Schark
Browse files

retires logs

parent dfb3503b
No related branches found
No related tags found
No related merge requests found
Pipeline #186014 failed
This commit is part of merge request !773. Comments created here will be created in the context of that merge request.
...@@ -13,6 +13,7 @@ import ( ...@@ -13,6 +13,7 @@ import (
amqp "github.com/rabbitmq/amqp091-go" amqp "github.com/rabbitmq/amqp091-go"
"github.com/sethvargo/go-retry" "github.com/sethvargo/go-retry"
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
...@@ -80,6 +81,7 @@ func NewEventService() (interfaces.Service, error) { ...@@ -80,6 +81,7 @@ func NewEventService() (interfaces.Service, error) {
} }
func connect(addr string) (*amqp.Connection, error) { func connect(addr string) (*amqp.Connection, error) {
var err error
retries := 60 retries := 60
for i := 0; i < retries; i++ { for i := 0; i < retries; i++ {
...@@ -87,10 +89,11 @@ func connect(addr string) (*amqp.Connection, error) { ...@@ -87,10 +89,11 @@ func connect(addr string) (*amqp.Connection, error) {
if err == nil { if err == nil {
return conn, nil return conn, nil
} }
logrus.Info("could not connect to RabbitMQ. Retrying in 2 seconds.")
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
} }
return nil, &customerrs.AMQPInitFailError{Action: "failed to connect to RabbitMQ", Err: err} return nil, &customerrs.AMQPInitFailError{Action: "finally failed to connect to RabbitMQ", Err: err}
} }
// Reconnect attempts to setup a new connection to the RabbitMQ server after an disconnect. // Reconnect attempts to setup a new connection to the RabbitMQ server after an disconnect.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment