From 1b045f6107dcdc63941748c4f20e4ff2f0007c48 Mon Sep 17 00:00:00 2001 From: Harlow Ward Date: Sat, 15 Nov 2014 13:51:55 -0800 Subject: [PATCH] Bump sleep time to 10s Noticed GetRecords error when a Shard's lease expired. * Added a timeout so we don't hit the rate limit on this type of error. * Increased the timeout when there are no Records on the stream. --- pipeline.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipeline.go b/pipeline.go index 9fc1af4..4d5ed4d 100644 --- a/pipeline.go +++ b/pipeline.go @@ -48,6 +48,7 @@ func (p Pipeline) ProcessShard(ksis *kinesis.Kinesis, shardID string) { if err != nil { fmt.Printf("GetRecords ERROR: %v\n", err) + time.Sleep(10 * time.Second) continue } @@ -71,7 +72,7 @@ func (p Pipeline) ProcessShard(ksis *kinesis.Kinesis, shardID string) { break } else { fmt.Printf("Sleeping: %v\n", shardID) - time.Sleep(5 * time.Second) + time.Sleep(10 * time.Second) } if p.Buffer.ShouldFlush() {