fix: rely on channels for synchronisation/sequence instead of sleep()

This commit is contained in:
Ron Waldon-Howe 2024-01-17 09:02:02 +11:00 committed by Victoria Brekenfeld
parent b724bddf49
commit 8e73c0f694

View file

@ -26,7 +26,7 @@ use tokio::{
mpsc::{self, Receiver, Sender}, mpsc::{self, Receiver, Sender},
oneshot, Mutex, oneshot, Mutex,
}, },
time::{sleep, Duration}, time::Duration,
}; };
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
use tracing::{metadata::LevelFilter, Instrument}; use tracing::{metadata::LevelFilter, Instrument};
@ -113,8 +113,6 @@ async fn start(
) )
.wrap_err("failed to start compositor")?; .wrap_err("failed to start compositor")?;
sleep(Duration::from_millis(2000)).await;
let mut env_vars = env_rx let mut env_vars = env_rx
.await .await
.expect("failed to receive environmental variables") .expect("failed to receive environmental variables")