Skip to content

Commit 2857d0a

Browse files
author
Ludo Galabru
committed
fix: re-arrange logs
1 parent 8dd91bf commit 2857d0a

File tree

1 file changed

+16
-15
lines changed
  • components/chainhook-cli/src/service

1 file changed

+16
-15
lines changed

components/chainhook-cli/src/service/mod.rs

+16-15
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,22 @@ impl Service {
165165
})
166166
.expect("unable to spawn thread");
167167

168+
// Enable HTTP Predicates API, if required
169+
if let PredicatesApi::On(ref api_config) = self.config.http_api {
170+
info!(
171+
self.ctx.expect_logger(),
172+
"Listening on port {} for chainhook predicate registrations", api_config.http_port
173+
);
174+
let ctx = self.ctx.clone();
175+
let api_config = api_config.clone();
176+
let moved_observer_command_tx = observer_command_tx.clone();
177+
// Test and initialize a database connection
178+
let _ = hiro_system_kit::thread_named("HTTP Predicate API").spawn(move || {
179+
let future = start_predicate_api_server(api_config, moved_observer_command_tx, ctx);
180+
let _ = hiro_system_kit::nestable_block_on(future);
181+
});
182+
}
183+
168184
info!(
169185
self.ctx.expect_logger(),
170186
"Listening on port {} for Stacks chain events", event_observer_config.ingestion_port
@@ -183,21 +199,6 @@ impl Service {
183199
);
184200
}
185201
}
186-
// Enable HTTP Chainhook API, if required
187-
if let PredicatesApi::On(ref api_config) = self.config.http_api {
188-
info!(
189-
self.ctx.expect_logger(),
190-
"Listening for chainhook predicate registrations on port {}", api_config.http_port
191-
);
192-
let ctx = self.ctx.clone();
193-
let api_config = api_config.clone();
194-
let moved_observer_command_tx = observer_command_tx.clone();
195-
// Test and initialize a database connection
196-
let _ = hiro_system_kit::thread_named("HTTP Predicate API").spawn(move || {
197-
let future = start_predicate_api_server(api_config, moved_observer_command_tx, ctx);
198-
let _ = hiro_system_kit::nestable_block_on(future);
199-
});
200-
}
201202

202203
let mut stacks_event = 0;
203204
loop {

0 commit comments

Comments
 (0)