Skip to content

Commit

Permalink
Check MillisBehindLatest in deciding to skip tick
Browse files Browse the repository at this point in the history
  • Loading branch information
jtackaberry committed Aug 1, 2020
1 parent 0a399d6 commit cdbd293
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit cdbd293

Please sign in to comment.