From b78c0ccea6d282c13bfe3775e335242b06259767 Mon Sep 17 00:00:00 2001 From: Ludo Galabru Date: Wed, 5 Jul 2023 17:35:03 -0400 Subject: [PATCH] fix: build error --- components/hord-cli/src/cli/mod.rs | 2 +- components/hord-cli/src/service/mod.rs | 48 ++++++++++++-------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/components/hord-cli/src/cli/mod.rs b/components/hord-cli/src/cli/mod.rs index cc5c2be9..48db8c57 100644 --- a/components/hord-cli/src/cli/mod.rs +++ b/components/hord-cli/src/cli/mod.rs @@ -330,7 +330,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> { info!(ctx.expect_logger(), "Starting service...",); let mut service = Service::new(config, ctx); - return service.run(predicates, cmd.hord_disabled).await; + return service.run(predicates).await; } }, Command::Config(subcmd) => match subcmd { diff --git a/components/hord-cli/src/service/mod.rs b/components/hord-cli/src/service/mod.rs index 69f591a9..ee3b096f 100644 --- a/components/hord-cli/src/service/mod.rs +++ b/components/hord-cli/src/service/mod.rs @@ -13,10 +13,9 @@ use crate::service::runloops::start_bitcoin_scan_runloop; use chainhook_sdk::chainhooks::types::{ BitcoinChainhookSpecification, ChainhookConfig, ChainhookFullSpecification, + ChainhookSpecification, }; -use chainhook_sdk::chainhooks::types::ChainhookSpecification; -use chainhook_sdk::chainhooks::types::{ChainhookConfig, ChainhookFullSpecification}; use chainhook_sdk::observer::{start_event_observer, ObserverEvent}; use chainhook_sdk::utils::Context; use chainhook_types::{BitcoinBlockSignaling, BitcoinChainEvent}; @@ -39,7 +38,6 @@ impl Service { pub async fn run( &mut self, predicates: Vec, - hord_disabled: bool, ) -> Result<(), String> { let mut chainhook_config = ChainhookConfig::new(); @@ -129,29 +127,27 @@ impl Service { let mut moved_event_observer_config = event_observer_config.clone(); let moved_ctx = self.ctx.clone(); - let _ = hiro_system_kit::thread_named("Initial predicate processing") - .spawn(move || { - if let Some(mut chainhook_config) = - moved_event_observer_config.chainhook_config.take() - { - let mut bitcoin_predicates_ref: Vec<&BitcoinChainhookSpecification> = - vec![]; - for bitcoin_predicate in chainhook_config.bitcoin_chainhooks.iter_mut() - { - bitcoin_predicate.enabled = false; - bitcoin_predicates_ref.push(bitcoin_predicate); - } - while let Ok(block) = rx.recv() { - let future = process_block_with_predicates( - block, - &bitcoin_predicates_ref, - &moved_event_observer_config, - &moved_ctx, - ); - let res = hiro_system_kit::nestable_block_on(future); - if let Err(_) = res { - error!(moved_ctx.expect_logger(), "Initial ingestion failing"); - } + let _ = hiro_system_kit::thread_named("Initial predicate processing") + .spawn(move || { + if let Some(mut chainhook_config) = + moved_event_observer_config.chainhook_config.take() + { + let mut bitcoin_predicates_ref: Vec<&BitcoinChainhookSpecification> = + vec![]; + for bitcoin_predicate in chainhook_config.bitcoin_chainhooks.iter_mut() { + bitcoin_predicate.enabled = false; + bitcoin_predicates_ref.push(bitcoin_predicate); + } + while let Ok(block) = rx.recv() { + let future = process_block_with_predicates( + block, + &bitcoin_predicates_ref, + &moved_event_observer_config, + &moved_ctx, + ); + let res = hiro_system_kit::nestable_block_on(future); + if let Err(_) = res { + error!(moved_ctx.expect_logger(), "Initial ingestion failing"); } } }