Skip to content

Commit

Permalink
Less logs in QuorumRpcReader (emeraldpay#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
a10zn8 authored Mar 21, 2023
1 parent a3a89ab commit 9d81bba
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ class QuorumRpcReader(
fun execute(key: JsonRpcRequest, retrySpec: reactor.util.retry.Retry): Function<Flux<Upstream>, Mono<CallQuorum>> {
val quorumReduce = BiFunction<CallQuorum, Tuple4<ByteArray, Optional<ResponseSigner.Signature>, Upstream, Optional<String>>, CallQuorum> { res, a ->
if (res.record(a.t1, a.t2.orElse(null), a.t3, a.t4.orElse(null))) {
log.debug("Quorum is resolved for method ${key.method}")
log.trace("Quorum is resolved for method ${key.method}")
apiControl.resolve()
} else {
log.debug("Quorum needs more responses for method ${key.method}")
log.trace("Quorum needs more responses for method ${key.method}")
// quorum needs more responses, so ask api controller to make another
apiControl.request(1)
}
Expand All @@ -113,7 +113,7 @@ class QuorumRpcReader(
quorum.isFailed() || quorum.isResolved()
}
.flatMap { api ->
log.debug("Calling upstream ${api.getId()} with method ${key.method}")
log.trace("Calling upstream ${api.getId()} with method ${key.method}")
callApi(api, key)
}
.retryWhen(retrySpec)
Expand Down Expand Up @@ -143,7 +143,7 @@ class QuorumRpcReader(
return SpannedReader(apiReader, tracer, API_READER, spanParams)
.read(key)
.flatMap { response ->
log.debug("Received response from upstream ${api.getId()} for method ${key.method}")
log.trace("Received response from upstream ${api.getId()} for method ${key.method}")
response.requireResult()
.transform(withSignatureAndUpstream(api, key, response))
}
Expand Down

0 comments on commit 9d81bba

Please sign in to comment.