Skip to content

Commit

Permalink
Merge pull request #61 from opsgenie/BIF-810
Browse files Browse the repository at this point in the history
BIF-810 Change polling strategy from short polling to long polling
  • Loading branch information
metehanozturk authored Jan 16, 2024
2 parents 79f203b + 29ebe37 commit 48760ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion queue/sqs_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion queue/sqs_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 48760ae

Please sign in to comment.