Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 689ca50

Browse files
authored
Remove a unnecessary sleep in run server (#32216)
remove sleep; and handle initializing connection as soon as available
1 parent d95e976 commit 689ca50

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

streamer/src/nonblocking/quic.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ use {
3636
},
3737
time::{Duration, Instant},
3838
},
39-
tokio::{
40-
task::JoinHandle,
41-
time::{sleep, timeout},
42-
},
39+
tokio::{task::JoinHandle, time::timeout},
4340
};
4441

4542
const WAIT_FOR_STREAM_TIMEOUT: Duration = Duration::from_millis(100);
@@ -135,7 +132,6 @@ async fn run_server(
135132
coalesce: Duration,
136133
) {
137134
const WAIT_FOR_CONNECTION_TIMEOUT: Duration = Duration::from_secs(1);
138-
const WAIT_BETWEEN_NEW_CONNECTIONS: Duration = Duration::from_millis(1);
139135
debug!("spawn quic server");
140136
let mut last_datapoint = Instant::now();
141137
let unstaked_connection_table: Arc<Mutex<ConnectionTable>> = Arc::new(Mutex::new(
@@ -173,7 +169,6 @@ async fn run_server(
173169
stats.clone(),
174170
wait_for_chunk_timeout,
175171
));
176-
sleep(WAIT_BETWEEN_NEW_CONNECTIONS).await;
177172
} else {
178173
debug!("accept(): Timed out waiting for connection");
179174
}

0 commit comments

Comments
 (0)