Skip to content

Commit

Permalink
pubsub/rabbitmq: return error if reconnect errors in Init (#3198)
Browse files Browse the repository at this point in the history
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: Bernd Verst <[email protected]>
Co-authored-by: Bernd Verst <[email protected]>
  • Loading branch information
JoshVanL and berndverst authored Oct 27, 2023
1 parent 896679e commit d47d1a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pubsub/rabbitmq/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit d47d1a7

Please sign in to comment.