Wait using the correct batch size

Otherwise waits tend to bust the rate-limiter batch size and it
doesn't wait at all.
This commit is contained in:
Bryan Boreham
2019-06-08 14:22:43 +00:00
parent 0368edf612
commit 89121cb509

View File

@@ -415,7 +415,7 @@ func (sc *scanner) deleteFromDynamoDB(batch []map[string]*dynamodb.AttributeValu
}
if err != nil {
if throttled(err) {
sc.writeLimiter.WaitN(context.Background(), len(batch))
sc.writeLimiter.WaitN(context.Background(), numToSend)
// Back round the loop without taking anything away from the batch
continue
} else {