Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed Jan 21, 2019
1 parent 92182b1 commit 59a92b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions broker/sqs/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,20 @@ func (q *queue) serve(s *sqs.SQS, tout time.Duration) {
q.wait = make(chan interface{})
atomic.StoreInt32(&q.active, 1)

var lastError error
var errored bool
for {
messages, stop, err := q.consume(s)
if err != nil {
if lastError != nil {
if errored {
// reoccurring error
time.Sleep(tout)
continue
} else {
lastError = err
errored = true
q.report(err)
}
}
lastError = nil
errored = false

if stop {
return
Expand Down

0 comments on commit 59a92b7

Please sign in to comment.