revert after review

This commit is contained in:
a10zn8
2023-06-22 14:56:01 +03:00
parent 49ec476c7a
commit 1b5b1f4732

View File

@@ -263,12 +263,12 @@ abstract class Multistream(
} }
override fun start() { override fun start() {
val repeated = Flux.interval(Duration.ofSeconds(3)) val repeated = Flux.interval(Duration.ofSeconds(30))
val whenChanged = observeStatus() val whenChanged = observeStatus()
.distinctUntilChanged() .distinctUntilChanged()
subscription = Flux.merge(repeated, whenChanged) subscription = Flux.merge(repeated, whenChanged)
// print status _change_ every 15 seconds, at most; otherwise prints it on interval of 30 seconds // print status _change_ every 15 seconds, at most; otherwise prints it on interval of 30 seconds
.sample(Duration.ofSeconds(3)) .sample(Duration.ofSeconds(15))
.subscribe { printStatus() } .subscribe { printStatus() }
observeUpstreamsStatuses() observeUpstreamsStatuses()