From 85caff4537540e7fac7096ea45ebda9b7a57a4dc Mon Sep 17 00:00:00 2001 From: Termina1 Date: Thu, 5 Jan 2023 20:34:56 +0200 Subject: [PATCH] fix node status subsciption for gRPC upstreams --- .../io/emeraldpay/dshackle/rpc/SubscribeNodeStatus.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/SubscribeNodeStatus.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/SubscribeNodeStatus.kt index 93013e66..c746fe2e 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/SubscribeNodeStatus.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/SubscribeNodeStatus.kt @@ -119,9 +119,11 @@ class SubscribeNodeStatus( val statuses = upstream.observeStatus() .distinctUntilChanged() - .takeUntil { it == UpstreamAvailability.UNAVAILABLE } + .takeUntil { + it == UpstreamAvailability.UNAVAILABLE && !upstream.isGrpc() + } .map { - if (it == UpstreamAvailability.UNAVAILABLE) { + if (it == UpstreamAvailability.UNAVAILABLE && !upstream.isGrpc()) { onUnavailable.accept(upstream.getId()) // cancel head subscription & reconnections when upstream becomes unavailable cancel.tryEmitNext(true)