Apply suggestions from code review

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
This commit is contained in:
Daniel Sullivan 2023-11-09 10:33:50 +01:00 committed by GitHub
parent 4a8dbc5a6b
commit b83935bb73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -477,6 +477,7 @@ func (im *DynamoDBRegistry) appendDelete(statements []*dynamodb.BatchStatementRe
func (im *DynamoDBRegistry) executeStatements(ctx context.Context, statements []*dynamodb.BatchStatementRequest, handleErr func(request *dynamodb.BatchStatementRequest, response *dynamodb.BatchStatementResponse) error) error {
for len(statements) > 0 {
var chunk []*dynamodb.BatchStatementRequest
// DynamoDB allows a maximum batch size of 25 items.
if len(statements) > 25 {
chunk = statements[:25]
statements = statements[25:]

View File

@ -295,7 +295,7 @@ func TestDynamoDBRegistryApplyChanges(t *testing.T) {
},
},
{
name: "create many",
name: "create more entries than DynamoDB batch size limit (25)",
changes: plan.Changes{
Create: []*endpoint.Endpoint{
{