Use scheduler for setupstream (#385)

This commit is contained in:
Nikolay G
2024-01-10 14:55:19 +00:00
committed by GitHub
parent 716255c48b
commit 38ccdcacac

View File

@@ -21,8 +21,12 @@ class LogsOracle(
db.SetUpstream(config.rpc)
subscription = upstream.getHead().getFlux()
.doOnError { t -> log.warn("Failed to subscribe head for oracle", t) }
.subscribe { db.UpdateHeight(it.height) }
.doOnError { t -> log.error("Failed to subscribe head for oracle", t) }
.subscribeOn(scheduler)
.subscribe {
log.info("update liboracle state: height=${it.height}")
db.UpdateHeight(it.height)
}
}
fun stop() {