feat: cascade hord activation

This commit is contained in:
Ludo Galabru
2023-05-18 10:21:41 -04:00
parent 239b26a614
commit 42c090ba7e
2 changed files with 3 additions and 2 deletions

View File

@@ -434,7 +434,7 @@ async fn handle_command(opts: Opts, ctx: Context) -> Result<(), String> {
}
let mut service = Service::new(config, ctx);
return service.run(predicates).await;
return service.run(predicates, cmd.hord_disabled).await;
}
},
Command::Config(subcmd) => match subcmd {

View File

@@ -30,7 +30,7 @@ impl Service {
Self { config, ctx }
}
pub async fn run(&mut self, predicates: Vec<ChainhookFullSpecification>) -> Result<(), String> {
pub async fn run(&mut self, predicates: Vec<ChainhookFullSpecification>, hord_disabled: bool) -> Result<(), String> {
let mut chainhook_config = ChainhookConfig::new();
if predicates.is_empty() {
@@ -87,6 +87,7 @@ impl Service {
let mut event_observer_config = self.config.get_event_observer_config();
event_observer_config.chainhook_config = Some(chainhook_config);
event_observer_config.ordinals_enabled = !hord_disabled;
info!(
self.ctx.expect_logger(),