diff --git a/src/app.rs b/src/app.rs index 3ec9806d..8bdc281a 100644 --- a/src/app.rs +++ b/src/app.rs @@ -76,6 +76,10 @@ pub async fn start(config: &Configuration, tracker: Arc) -> Vec { let launcher = self.state.launcher; let task = tokio::spawn(async move { - launcher.start(tracker, access_tokens, tx_start, rx_halt).await; + debug!(target: "API", "Starting with launcher in spawned task ..."); + + let _task = launcher.start(tracker, access_tokens, tx_start, rx_halt).await; + + debug!(target: "API", "Started with launcher in spawned task"); + launcher }); @@ -266,9 +271,10 @@ mod tests { #[tokio::test] async fn it_should_be_able_to_start_and_stop() { let cfg = Arc::new(ephemeral_mode_public()); - let tracker = initialize_with_configuration(&cfg); let config = &cfg.http_api; + let tracker = initialize_with_configuration(&cfg); + let bind_to = config .bind_address .parse::() diff --git a/src/servers/registar.rs b/src/servers/registar.rs index 0fb8d6ac..9c23573c 100644 --- a/src/servers/registar.rs +++ b/src/servers/registar.rs @@ -5,6 +5,7 @@ use std::net::SocketAddr; use std::sync::Arc; use derive_more::Constructor; +use log::debug; use tokio::sync::Mutex; use tokio::task::JoinHandle; @@ -81,10 +82,15 @@ impl Registar { /// Inserts a listing into the registry. async fn insert(&self, rx: tokio::sync::oneshot::Receiver) { - let listing = rx.await.expect("it should receive the listing"); + debug!("Waiting for the started service to send registration data ..."); + + let service_registration = rx + .await + .expect("it should receive the service registration from the started service"); let mut mutex = self.registry.lock().await; - mutex.insert(listing.binding, listing); + + mutex.insert(service_registration.binding, service_registration); } /// Returns the [`ServiceRegistry`] of services