Skip to content

Commit

Permalink
Fix npe (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillPamPam authored Oct 23, 2024
1 parent 697db61 commit d2d722a
Showing 1 changed file with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d2d722a

Please sign in to comment.