Skip to content

Commit

Permalink
lint: in the shadow of errs
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Nov 2, 2023
1 parent b5b97c2 commit 46fcd1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions broker/nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func (n *NATS) addStreamConsumer(stream string) {
createConsumer:
prefixedStream := streamPrefix + stream

_, err = n.jconsumers.fetch(stream, func() (jetstream.Consumer, error) { // nolint:errcheck
_, cerr := n.jconsumers.fetch(stream, func() (jetstream.Consumer, error) { // nolint:errcheck
cons, err := n.js.CreateConsumer(context.Background(), prefixedStream, jetstream.ConsumerConfig{
AckPolicy: jetstream.AckNonePolicy,
})
Expand Down Expand Up @@ -411,8 +411,8 @@ createConsumer:
n.js.DeleteConsumer(context.Background(), prefixedStream, name) // nolint:errcheck
})

if err != nil {
if context.DeadlineExceeded == err {
if cerr != nil {
if context.DeadlineExceeded == cerr {
if attempts > 0 {
attempts--
n.log.Warnf("failed to create consumer for stream %s, retrying in 500ms...", stream)
Expand Down

0 comments on commit 46fcd1b

Please sign in to comment.