diff --git a/queue/sqs_provider.go b/queue/sqs_provider.go index 7a97bcc..3dbf5bc 100644 --- a/queue/sqs_provider.go +++ b/queue/sqs_provider.go @@ -117,7 +117,7 @@ func (qp *sqsProvider) ReceiveMessage(maxNumOfMessage int64, visibilityTimeout i QueueUrl: &queueUrl, MaxNumberOfMessages: aws.Int64(maxNumOfMessage), VisibilityTimeout: aws.Int64(visibilityTimeout), - WaitTimeSeconds: aws.Int64(0), + WaitTimeSeconds: aws.Int64(20), } qp.refreshClientMu.RLock() diff --git a/queue/sqs_provider_test.go b/queue/sqs_provider_test.go index 5752b2b..2246eaf 100644 --- a/queue/sqs_provider_test.go +++ b/queue/sqs_provider_test.go @@ -107,7 +107,7 @@ func TestReceiveMessage(t *testing.T) { assert.Equal(t, 2, len(messages)) assert.Equal(t, int64(30), *capturedInput.VisibilityTimeout) assert.Equal(t, mockQueueUrl1, *capturedInput.QueueUrl) - assert.Equal(t, int64(0), *capturedInput.WaitTimeSeconds) // because of short polling + assert.Equal(t, int64(20), *capturedInput.WaitTimeSeconds) assert.Equal(t, int64(10), *capturedInput.MaxNumberOfMessages) assert.Equal(t, 2, len(capturedInput.MessageAttributeNames)) assert.Equal(t, "ownerId", *capturedInput.MessageAttributeNames[0])