Skip to content

Commit

Permalink
Merge pull request #31 from practo/sqs-dlq-fix
Browse files Browse the repository at this point in the history
Long poll only when messages is also 0
  • Loading branch information
alok87 authored Sep 14, 2019
2 parents ab7e4e1 + a4f248c commit 68c8f3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/queue/sqs.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (s *SQS) waitForShortPollInterval() {
}

func (s *SQS) poll(key string, queueSpec QueueSpec) {
if queueSpec.workers == 0 {
if queueSpec.workers == 0 && queueSpec.messages == 0 {
s.queues.updateIdleWorkers(key, -1)

// If there are no workers running we do a long poll to find a job(s)
Expand Down

0 comments on commit 68c8f3d

Please sign in to comment.