From 8a2455fcd1f3b817870f0415beeea895d4a1c263 Mon Sep 17 00:00:00 2001 From: a10zn8 Date: Tue, 28 Mar 2023 21:28:22 +0400 Subject: [PATCH] Clients stream should be sequentially concated (#187) * Clients stream should be sequentially concated * remove debug log --- .../kotlin/io/emeraldpay/dshackle/upstream/HeadLagObserver.kt | 1 - .../kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/HeadLagObserver.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/HeadLagObserver.kt index 1712585e..054c4247 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/HeadLagObserver.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/HeadLagObserver.kt @@ -61,7 +61,6 @@ abstract class HeadLagObserver( .sample(throttling) .flatMap(this::probeFollowers) .map { item -> - log.debug("Set to ${item.t2.getId()} lag = ${item.t1}") item.t2.setLag(item.t1) } } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt index d096d9b1..7cf6e2d7 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/GrpcHead.kt @@ -76,7 +76,7 @@ class GrpcHead( .repeat() .delayElements(Duration.ofSeconds(1)) ) - .flatMap { it.subscribeHead(chainRef) } + .concatMap({ it.subscribeHead(chainRef) }, 0) .doOnNext { headsCounter.increment() }