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

This commit is contained in:
Joakim Frostegård 2021-11-16 23:06:29 +01:00
parent 5d8a4dd38c
commit 7afaa2702a
2 changed files with 3 additions and 3 deletions

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,
}
}
}

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) {