Use scheduler for setupstream (#385)
This commit is contained in:
@@ -21,8 +21,12 @@ class LogsOracle(
|
|||||||
db.SetUpstream(config.rpc)
|
db.SetUpstream(config.rpc)
|
||||||
|
|
||||||
subscription = upstream.getHead().getFlux()
|
subscription = upstream.getHead().getFlux()
|
||||||
.doOnError { t -> log.warn("Failed to subscribe head for oracle", t) }
|
.doOnError { t -> log.error("Failed to subscribe head for oracle", t) }
|
||||||
.subscribe { db.UpdateHeight(it.height) }
|
.subscribeOn(scheduler)
|
||||||
|
.subscribe {
|
||||||
|
log.info("update liboracle state: height=${it.height}")
|
||||||
|
db.UpdateHeight(it.height)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun stop() {
|
fun stop() {
|
||||||
|
|||||||
Reference in New Issue
Block a user