Skip to content

Commit f15fdae

Browse files
Don't sleep the thread in async
1 parent 5fc9bc2 commit f15fdae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/core/src/bc_protocol/talk.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ impl BcCamera {
410410
// Chunks are still being played, while talk_stop will interrupt them. Wait until we expect
411411
// the stream to end (+ and extra 100ms) before issuing talk_stop.
412412
let remaining_stream_duration = expected_stream_end - std::time::Instant::now();
413-
std::thread::sleep(remaining_stream_duration + std::time::Duration::from_secs_f32(0.1));
413+
tokio::time::sleep(remaining_stream_duration + std::time::Duration::from_secs_f32(0.1))
414+
.await;
414415

415416
self.talk_stop().await?;
416417

0 commit comments

Comments
 (0)