Add verbose messaging for aws/sqs

This commit is contained in:
tidwall 2019-03-17 18:40:34 -07:00
parent bb6ff9e737
commit 7e006af713
1 changed files with 5 additions and 3 deletions

View File

@ -12,6 +12,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sqs" "github.com/aws/aws-sdk-go/service/sqs"
"github.com/streadway/amqp" "github.com/streadway/amqp"
"github.com/tidwall/tile38/internal/log"
) )
var errCreateQueue = errors.New("Error while creating queue") var errCreateQueue = errors.New("Error while creating queue")
@ -86,9 +87,10 @@ func (conn *SQSConn) Send(msg string) error {
region = sqsRegionFromPlainURL(conn.ep.SQS.PlainURL) region = sqsRegionFromPlainURL(conn.ep.SQS.PlainURL)
} }
sess := session.Must(session.NewSession(&aws.Config{ sess := session.Must(session.NewSession(&aws.Config{
Region: &region, Region: &region,
Credentials: creds, Credentials: creds,
MaxRetries: aws.Int(5), CredentialsChainVerboseErrors: aws.Bool(log.Level >= 3),
MaxRetries: aws.Int(5),
})) }))
svc := sqs.New(sess) svc := sqs.New(sess)
if conn.ep.SQS.CreateQueue { if conn.ep.SQS.CreateQueue {