Skip to content

Commit

Permalink
fix(RabbitMQQueue): handle ack error
Browse files Browse the repository at this point in the history
  • Loading branch information
kwkwc committed May 29, 2024
1 parent e187bf2 commit f62f4b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion queues/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ func (q *RabbitMQQueue) handleMessage(ctx context.Context) {
return
case d := <-msgs:
q.jobC <- d.Body
d.Ack(false)
err := d.Ack(false)
if err != nil {
slog.Error(fmt.Sprintf("RabbitMQQueue ack error: `%s`", err))
time.Sleep(1 * time.Second)
continue

Check warning on line 166 in queues/rabbitmq.go

View check run for this annotation

Codecov / codecov/patch

queues/rabbitmq.go#L164-L166

Added lines #L164 - L166 were not covered by tests
}
}
}
}

0 comments on commit f62f4b3

Please sign in to comment.