tmaret commented on a change in pull request #28:
URL:
https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/28#discussion_r428115589
##########
File path:
src/main/java/org/apache/sling/distribution/journal/impl/publisher/DiscoveryService.java
##########
@@ -151,12 +157,14 @@ public void handle(MessageInfo info, DiscoveryMessage
disMsg) {
long now = System.currentTimeMillis();
AgentId subAgentId = new AgentId(disMsg.getSubSlingId(),
disMsg.getSubAgentName());
-
+ long minOffset = 0;
for (Messages.SubscriberState subStateMsg :
disMsg.getSubscriberStateList()) {
SubscriberConfiguration subConfig =
disMsg.getSubscriberConfiguration();
State subState = new State(subStateMsg.getPubAgentName(),
subAgentId.getAgentId(), now, subStateMsg.getOffset(),
subStateMsg.getRetries(), subConfig.getMaxRetries(), subConfig.getEditable());
viewManager.refreshState(subState);
+ minOffset = Math.min(minOffset, subState.getOffset());
Review comment:
There's a bug smell here. The minOffset will always be 0 since we get
the `min`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]