fix: re-arrange logs

This commit is contained in:
Ludo Galabru
2023-06-26 14:26:53 -04:00
parent 8dd91bfce3
commit 2857d0a1a4

View File

@@ -165,6 +165,22 @@ impl Service {
})
.expect("unable to spawn thread");
// Enable HTTP Predicates API, if required
if let PredicatesApi::On(ref api_config) = self.config.http_api {
info!(
self.ctx.expect_logger(),
"Listening on port {} for chainhook predicate registrations", api_config.http_port
);
let ctx = self.ctx.clone();
let api_config = api_config.clone();
let moved_observer_command_tx = observer_command_tx.clone();
// Test and initialize a database connection
let _ = hiro_system_kit::thread_named("HTTP Predicate API").spawn(move || {
let future = start_predicate_api_server(api_config, moved_observer_command_tx, ctx);
let _ = hiro_system_kit::nestable_block_on(future);
});
}
info!(
self.ctx.expect_logger(),
"Listening on port {} for Stacks chain events", event_observer_config.ingestion_port
@@ -183,21 +199,6 @@ impl Service {
);
}
}
// Enable HTTP Chainhook API, if required
if let PredicatesApi::On(ref api_config) = self.config.http_api {
info!(
self.ctx.expect_logger(),
"Listening for chainhook predicate registrations on port {}", api_config.http_port
);
let ctx = self.ctx.clone();
let api_config = api_config.clone();
let moved_observer_command_tx = observer_command_tx.clone();
// Test and initialize a database connection
let _ = hiro_system_kit::thread_named("HTTP Predicate API").spawn(move || {
let future = start_predicate_api_server(api_config, moved_observer_command_tx, ctx);
let _ = hiro_system_kit::nestable_block_on(future);
});
}
let mut stacks_event = 0;
loop {