Update the lastRequestTime to prevent overlapping restarts. (#373)

When a restart occurs due to no activity set the lastRequestTime to
now to prevent ti from overlapping itself.
This commit is contained in:
Justin Pfifer 2018-08-20 09:25:57 -07:00 committed by Sahil Palvia
parent 2e2c892b7e
commit c1e38f0126

View file

@ -265,6 +265,11 @@ public class ShardConsumer {
if (subscriber != null) {
subscriber.cancel();
}
//
// Set the last request time to now, we specifically don't null it out since we want it to trigger a
// restart if the subscription still doesn't start producing.
//
lastRequestTime = Instant.now();
startSubscriptions();
}
}