Respect logWarningForTaskAfterMillis for logging a retrieval warning (#383)

Only log a warning if it's been > logWarningForTaskAfterMillis time
since data was last received.
This commit is contained in:
Justin Pfifer 2018-08-23 13:16:53 -07:00 committed by Sahil Palvia
parent e3eff0dc3c
commit 99667e8f50

View file

@ -299,8 +299,10 @@ public class ShardConsumer {
if (lastDataArrival != null) {
Instant now = Instant.now();
Duration timeSince = Duration.between(subscriber.lastDataArrival, now);
if (timeSince.toMillis() > value) {
log.warn("Last time data arrived: {} ({})", lastDataArrival, timeSince);
}
}
});
}