udp: config: request worker timeout in ms instead of microseconds

This commit is contained in:
Joakim Frostegård committed 2021-11-18 22:42:36 +01:00
1 parent 5d8a4dd38c
commit 7afaa2702a
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -75,7 +75,7 @@ pub struct HandlerConfig {
/// Maximum number of requests to receive from channel before locking
/// mutex and starting work
pub max_requests_per_iter: usize,
pub channel_recv_timeout_microseconds: u64,
pub channel_recv_timeout_ms: u64,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
@@ -143,7 +143,7 @@ impl Default for HandlerConfig {
fn default() -> Self {
Self {
max_requests_per_iter: 10000,
channel_recv_timeout_microseconds: 200,
channel_recv_timeout_ms: 100,
}
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ pub fn run_request_worker(
let mut torrents = TorrentMaps::default();
let mut small_rng = SmallRng::from_entropy();
let timeout = Duration::from_micros(config.handlers.channel_recv_timeout_microseconds);
let timeout = Duration::from_millis(config.handlers.channel_recv_timeout_ms);
loop {
if let Ok((sender_index, request, src)) = request_receiver.recv_timeout(timeout) {