pubsub/rabbitmq: return error if reconnect errors in Init (#3198)
Signed-off-by: joshvanl <me@joshvanl.dev> Signed-off-by: Bernd Verst <github@bernd.dev> Co-authored-by: Bernd Verst <github@bernd.dev>
This commit is contained in:
parent
896679e0b0
commit
d47d1a7aad
|
|
@ -154,10 +154,10 @@ func (r *rabbitMQ) Init(_ context.Context, metadata pubsub.Metadata) error {
|
|||
|
||||
r.metadata = meta
|
||||
|
||||
r.reconnect(0)
|
||||
// We do not return error on reconnect because it can cause problems if init() happens
|
||||
// right at the restart window for service. So, we try it now but there is logic in the
|
||||
// code to reconnect as many times as needed.
|
||||
if err := r.reconnect(0); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue