This commit is contained in:
KirillPamPam
2024-10-23 18:45:33 +04:00
committed by GitHub
parent 697db618b7
commit d2d722a0e8

View File

@@ -246,26 +246,28 @@ open class GenericUpstream(
} }
private fun detectSettings() { private fun detectSettings() {
settingsDetectorSubscription.set( if (settingsDetector != null) {
Flux.interval( settingsDetectorSubscription.set(
Duration.ZERO, Flux.interval(
Duration.ofSeconds(getOptions().validationInterval.toLong() * 5), Duration.ZERO,
).flatMap { Duration.ofSeconds(getOptions().validationInterval.toLong() * 5),
Flux.merge( ).flatMap {
settingsDetector?.detectLabels() Flux.merge(
?.doOnNext { label -> settingsDetector.detectLabels()
updateLabels(label) .doOnNext { label ->
sendUpstreamStateEvent(UPDATED) updateLabels(label)
}, sendUpstreamStateEvent(UPDATED)
settingsDetector?.detectClientVersion() },
?.doOnNext { settingsDetector.detectClientVersion()
log.info("Detected node version $it for upstream ${getId()}") .doOnNext {
clientVersion.set(it) log.info("Detected node version $it for upstream ${getId()}")
}, clientVersion.set(it)
) },
.subscribeOn(settingsScheduler) )
}.subscribe(), .subscribeOn(settingsScheduler)
) }.subscribe(),
)
}
} }
private fun detectRpcMethods( private fun detectRpcMethods(