Skip to content

Commit

Permalink
Don't sleep the thread in async
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumEntangledAndy committed Aug 4, 2024
1 parent 5fc9bc2 commit f15fdae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/core/src/bc_protocol/talk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ impl BcCamera {
// Chunks are still being played, while talk_stop will interrupt them. Wait until we expect
// the stream to end (+ and extra 100ms) before issuing talk_stop.
let remaining_stream_duration = expected_stream_end - std::time::Instant::now();
std::thread::sleep(remaining_stream_duration + std::time::Duration::from_secs_f32(0.1));
tokio::time::sleep(remaining_stream_duration + std::time::Duration::from_secs_f32(0.1))
.await;

self.talk_stop().await?;

Expand Down

0 comments on commit f15fdae

Please sign in to comment.