Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ws connection to separate scheduler #330

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove head liveness
Кирилл committed Oct 31, 2023
commit c9a40aed2343b901a4d85e10cd12363119727387
Original file line number Diff line number Diff line change
@@ -138,12 +138,12 @@ open class EthereumLikeRpcUpstream(
validatorSubscription = validator.start()
.subscribe(this::setStatus)
}
livenessSubscription = connector.hasLiveSubscriptionHead().subscribe({
hasLiveSubscriptionHead.set(it)
eventPublisher?.publishEvent(UpstreamChangeEvent(chain, this, UpstreamChangeEvent.ChangeType.UPDATED))
}, {
log.debug("Error while checking live subscription for ${getId()}", it)
},)
// livenessSubscription = connector.hasLiveSubscriptionHead().subscribe({
// hasLiveSubscriptionHead.set(it)
// eventPublisher?.publishEvent(UpstreamChangeEvent(chain, this, UpstreamChangeEvent.ChangeType.UPDATED))
// }, {
// log.debug("Error while checking live subscription for ${getId()}", it)
// },)
}

private fun updateLabels(label: Pair<String, String>) {
Original file line number Diff line number Diff line change
@@ -7,8 +7,6 @@ import io.emeraldpay.dshackle.config.UpstreamsConfig.Labels
import io.emeraldpay.dshackle.foundation.ChainOptions
import io.emeraldpay.dshackle.reader.JsonRpcReader
import io.emeraldpay.dshackle.startup.QuorumForLabels
import io.emeraldpay.dshackle.startup.UpstreamChangeEvent
import io.emeraldpay.dshackle.startup.UpstreamChangeEvent.ChangeType.UPDATED
import io.emeraldpay.dshackle.upstream.Capability
import io.emeraldpay.dshackle.upstream.DefaultUpstream
import io.emeraldpay.dshackle.upstream.Head
@@ -83,12 +81,12 @@ class GenericUpstream(
log.info("Configured for ${chain.chainName}")
connector.start()

livenessSubscription = connector.hasLiveSubscriptionHead().subscribe({
hasLiveSubscriptionHead.set(it)
eventPublisher?.publishEvent(UpstreamChangeEvent(chain, this, UPDATED))
}, {
log.debug("Error while checking live subscription for ${getId()}", it)
},)
// livenessSubscription = connector.hasLiveSubscriptionHead().subscribe({
// hasLiveSubscriptionHead.set(it)
// eventPublisher?.publishEvent(UpstreamChangeEvent(chain, this, UPDATED))
// }, {
// log.debug("Error while checking live subscription for ${getId()}", it)
// },)
}

override fun stop() {