Skip to content

Commit

Permalink
remove unneccessary enumerate request
Browse files Browse the repository at this point in the history
  • Loading branch information
feschber committed Jan 16, 2024
1 parent 347256e commit 7897db6
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,26 +417,6 @@ impl Server {
}
});

// initial sync of clients
frontend_tx.send(FrontendEvent::Enumerate()).await?;
let active = self
.client_manager
.borrow()
.get_client_states()
.filter_map(|s| {
if s.active {
Some(s.client.handle)
} else {
None
}
})
.collect::<Vec<_>>();
for client in active {
frontend_tx
.send(FrontendEvent::ActivateClient(client, true))
.await?;
}

tokio::select! {
_ = signal::ctrl_c() => {
log::info!("terminating service");
Expand Down Expand Up @@ -862,6 +842,7 @@ impl Server {

let tx = frontend_tx.clone();
tokio::task::spawn_local(async move {
let _ = tx.send(FrontendEvent::Enumerate()).await;
loop {
let event = frontend::read_event(&mut stream).await;
match event {
Expand Down

0 comments on commit 7897db6

Please sign in to comment.