From 082af68785a30de63f6c790914b62eb833f3e4ea Mon Sep 17 00:00:00 2001 From: EYJ Date: Wed, 5 Oct 2016 17:55:56 +0200 Subject: [PATCH] Make sure to obey rate limit --- reader.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reader.go b/reader.go index 075962c..d67a317 100644 --- a/reader.go +++ b/reader.go @@ -126,6 +126,9 @@ func BatchRecords(records <-chan Record, batches chan<- []Record, batchSize int) // Switch buffers before we start building the next batch. currentBuf = (currentBuf + 1) % 2 next = 0 + + // Make sure we do not violate the AWS limit of 5 submissions/second + time.Sleep(250 * time.Millisecond) } }