Skip to content

Commit

Permalink
problem: fails to add another dshackle upstream if any of blockchain …
Browse files Browse the repository at this point in the history
…is unsupported
  • Loading branch information
splix committed Sep 1, 2020
1 parent c14255d commit c346c27
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class GrpcUpstreams(
prev?.dispose()
subscription
}
}.doOnError { t ->
log.error("Failed to process update from gRPC upstream $id", t)
}

return updates
Expand All @@ -109,11 +111,16 @@ class GrpcUpstreams(
fun processDescription(value: BlockchainOuterClass.DescribeResponse): Flux<UpstreamChange> {
val current = value.chainsList.filter {
Chain.byId(it.chain.number) != Chain.UNSPECIFIED
}.map { chainDetails ->
val chain = Chain.byId(chainDetails.chain.number)
val up = getOrCreate(chain)
(up.upstream as EthereumGrpcUpstream).init(chainDetails)
up
}.mapNotNull { chainDetails ->
try {
val chain = Chain.byId(chainDetails.chain.number)
val up = getOrCreate(chain)
(up.upstream as EthereumGrpcUpstream).init(chainDetails)
up
} catch (e: Throwable) {
log.warn("Skip unsupported upstream ${chainDetails.chain} on $id: ${e.message}")
null
}
}

val added = current.filter {
Expand Down

0 comments on commit c346c27

Please sign in to comment.