solution: config option to disable an upstream
This commit is contained in:
@@ -616,6 +616,11 @@ Fallback role mean that the upstream is used only after other upstreams failed o
|
||||
Cluster may have multiple upstreams for a single blockchain.
|
||||
Accepted types: `bitcoin`, `bitcoin-testnet`, `ethereum`, `ethereum-classic`, `kovan-testnet`, `rinkeby-testnet`, `ropsten-testnet`, or `goerli-testnet`
|
||||
|
||||
| `enabled`
|
||||
| no
|
||||
| `true` (default) or `false`.
|
||||
Enable/disable the upstream.
|
||||
|
||||
| `labels`
|
||||
| no
|
||||
| Key-Value pairs that are assigned to the upstream.
|
||||
|
||||
@@ -194,6 +194,9 @@ class UpstreamsConfigReader(
|
||||
upstream.id = getValueAsString(upNode, "id")
|
||||
upstream.options = tryReadOptions(upNode)
|
||||
upstream.methods = tryReadMethods(upNode)
|
||||
getValueAsBool(upNode, "enabled")?.let {
|
||||
upstream.isEnabled = it
|
||||
}
|
||||
}
|
||||
|
||||
internal fun readUpstreamGrpc(
|
||||
|
||||
@@ -63,6 +63,10 @@ open class ConfiguredUpstreams(
|
||||
log.debug("Starting upstreams")
|
||||
val defaultOptions = buildDefaultOptions(config)
|
||||
config.upstreams.forEach { up ->
|
||||
if (!up.isEnabled) {
|
||||
log.debug("Upstream ${up.id} is disabled")
|
||||
return@forEach
|
||||
}
|
||||
log.debug("Start upstream ${up.id}")
|
||||
if (up.connection is UpstreamsConfig.GrpcConnection) {
|
||||
val options = up.options ?: UpstreamsConfig.Options()
|
||||
|
||||
Reference in New Issue
Block a user