Skip to content

Commit

Permalink
fix(RabbitMQQueue): handle ack error (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwkwc authored May 29, 2024
1 parent e187bf2 commit 89ed6fd
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
}
}
}
}

0 comments on commit 89ed6fd

Please sign in to comment.