From 89121cb509daeaeadb34e3f7fdb359f3ff2ddfc9 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Sat, 8 Jun 2019 14:22:43 +0000 Subject: [PATCH] Wait using the correct batch size Otherwise waits tend to bust the rate-limiter batch size and it doesn't wait at all. --- extras/scanner/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/scanner/main.go b/extras/scanner/main.go index 8ad9a7b5f..be8f528e9 100644 --- a/extras/scanner/main.go +++ b/extras/scanner/main.go @@ -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 {