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:
Josh van Leeuwen 2023-10-27 18:38:43 +01:00 committed by GitHub
parent 896679e0b0
commit d47d1a7aad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

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