From 38ccdcacac69839918078ee4114cbe2681239b21 Mon Sep 17 00:00:00 2001 From: Nikolay G Date: Wed, 10 Jan 2024 14:55:19 +0000 Subject: [PATCH] Use scheduler for setupstream (#385) --- .../kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt index 77e51a09..889f379b 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt @@ -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() {