Skip to content

Commit

Permalink
fix: send message to DLQ after correct number of attempts
Browse files Browse the repository at this point in the history
Closes: #263
  • Loading branch information
Thomasvdam committed Oct 3, 2024
1 parent 1a058d0 commit 95c4ab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/gosqs/gosqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func PeriodicTasks(d time.Duration, quit <-chan struct{}) {
msg.Retry++
if queue.MaxReceiveCount > 0 &&
queue.DeadLetterQueue != nil &&
msg.Retry > queue.MaxReceiveCount {
msg.Retry >= queue.MaxReceiveCount {
queue.DeadLetterQueue.Messages = append(queue.DeadLetterQueue.Messages, *msg)
queue.Messages = append(queue.Messages[:i], queue.Messages[i+1:]...)
i++
i--
}
}
}
Expand Down

0 comments on commit 95c4ab3

Please sign in to comment.