mkapalka commented on code in PR #2828:
URL: https://github.com/apache/jackrabbit-oak/pull/2828#discussion_r3026855146
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/ElasticResultRowAsyncIterator.java:
##########
@@ -344,7 +344,8 @@ class ElasticQueryScanner {
ongoingRequest = indexNode.getConnection().getAsyncClient()
.search(searchRequest, ObjectNode.class)
- .whenComplete((this::handleResponse));
+ .whenCompleteAsync((response, throwable) ->
+ handleResponse(response, throwable,
System.currentTimeMillis()));
Review Comment:
I wonder: call to `System.currentTimeMillis()` is inside lambda, which means
that it's executed immediately before the call to `handleResponse`, which
almost directly calls `onSuccess` / `onFailure`. I'm then not sure why this
makes a difference compared to the previous code where `onSuccess` /
`onFailure` gets the current timestamp directly. Do I miss something here?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]