Skip to content
Snippets Groups Projects

Resolve "Investigate GitLab-CI services don't reach each other"

1 file
+ 9
4
Compare changes
  • Side-by-side
  • Inline
@@ -80,12 +80,17 @@ func NewEventService() (interfaces.Service, error) {
}
func connect(addr string) (*amqp.Connection, error) {
conn, err := amqp.Dial(addr)
if err != nil {
return nil, &customerrs.AMQPInitFailError{Action: "failed to connect to RabbitMQ", Err: err}
retries := 60
for i := 0; i < retries; i++ {
conn, err := amqp.Dial(addr)
if err == nil {
return conn, nil
}
time.Sleep(2 * time.Second)
}
return conn, nil
return nil, &customerrs.AMQPInitFailError{Action: "failed to connect to RabbitMQ", Err: err}
}
// Reconnect attempts to setup a new connection to the RabbitMQ server after an disconnect.
Loading