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() {
settingsDetectorSubscription.set(
Flux.interval(
Duration.ZERO,
Duration.ofSeconds(getOptions().validationInterval.toLong() * 5),
).flatMap {
Flux.merge(
settingsDetector?.detectLabels()
?.doOnNext { label ->
updateLabels(label)
sendUpstreamStateEvent(UPDATED)
},
settingsDetector?.detectClientVersion()
?.doOnNext {
log.info("Detected node version $it for upstream ${getId()}")
clientVersion.set(it)
},
)
.subscribeOn(settingsScheduler)
}.subscribe(),
)
if (settingsDetector != null) {
settingsDetectorSubscription.set(
Flux.interval(
Duration.ZERO,
Duration.ofSeconds(getOptions().validationInterval.toLong() * 5),
).flatMap {
Flux.merge(
settingsDetector.detectLabels()
.doOnNext { label ->
updateLabels(label)
sendUpstreamStateEvent(UPDATED)
},
settingsDetector.detectClientVersion()
.doOnNext {
log.info("Detected node version $it for upstream ${getId()}")
clientVersion.set(it)
},
)
.subscribeOn(settingsScheduler)
}.subscribe(),
)
}
}
private fun detectRpcMethods(