From cdbd2938558713cfac1fb1707a66cbb4177b178e Mon Sep 17 00:00:00 2001 From: Jason Tackaberry Date: Sat, 1 Aug 2020 18:31:25 -0400 Subject: [PATCH] Check MillisBehindLatest in deciding to skip tick --- consumer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consumer.go b/consumer.go index bd4a7eaf..af8d1171 100644 --- a/consumer.go +++ b/consumer.go @@ -208,8 +208,8 @@ func (c *Consumer) ScanShard(ctx context.Context, shardID string, fn ScanFunc) e } shardIterator = resp.NextShardIterator - if c.immediateRescan && len(resp.Records) > 0 { - // We have records with immediate rescan enabled, so skip waiting for next tick + if c.immediateRescan && len(resp.Records) > 0 && *resp.MillisBehindLatest > 0 { + // There appears to be additional records, so skip waiting for next tick continue } }