From 29ebe37f59d2e88ec263d2e8a2e32e397e6fd0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Metehan=20=C3=96zt=C3=BCrk?= Date: Mon, 15 Jan 2024 23:52:21 +0300 Subject: [PATCH] BIF-810 Change polling strategy from short polling to long polling --- queue/sqs_provider.go | 2 +- queue/sqs_provider_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/queue/sqs_provider.go b/queue/sqs_provider.go index a5e79283..59204c09 100644 --- a/queue/sqs_provider.go +++ b/queue/sqs_provider.go @@ -115,7 +115,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 f995a0c6..2fb33985 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, 1, len(capturedInput.MessageAttributeNames)) assert.Equal(t, "ownerId", *capturedInput.MessageAttributeNames[0])