Skip to content

Commit

Permalink
resource/aws_dynamodb_table_item: Cleanup + add missing bits
Browse files Browse the repository at this point in the history
 - Use standard retry helpers
 - Simplify code by extracting code into reusable functions
 - Add validation
 - Add missing acceptance tests
 - Add missing docs
  • Loading branch information
radeksimko committed Feb 9, 2018
1 parent 6a79b7c commit 1c0871b
Show file tree
Hide file tree
Showing 6 changed files with 653 additions and 335 deletions.
10 changes: 10 additions & 0 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,16 @@ func (c *Config) Client() (interface{}, error) {
}
})

// See https://github.com/aws/aws-sdk-go/pull/1276
client.dynamodbconn.Handlers.Retry.PushBack(func(r *request.Request) {
if r.Operation.Name != "PutItem" && r.Operation.Name != "UpdateItem" && r.Operation.Name != "DeleteItem" {
return
}
if isAWSErr(r.Error, dynamodb.ErrCodeLimitExceededException, "Subscriber limit exceeded:") {
r.Retryable = aws.Bool(true)
}
})

return &client, nil
}

Expand Down
Loading

0 comments on commit 1c0871b

Please sign in to comment.