mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
udp: config: request worker timeout in ms instead of microseconds
This commit is contained in:
parent
5d8a4dd38c
commit
7afaa2702a
2 changed files with 3 additions and 3 deletions
|
|
@ -75,7 +75,7 @@ pub struct HandlerConfig {
|
||||||
/// Maximum number of requests to receive from channel before locking
|
/// Maximum number of requests to receive from channel before locking
|
||||||
/// mutex and starting work
|
/// mutex and starting work
|
||||||
pub max_requests_per_iter: usize,
|
pub max_requests_per_iter: usize,
|
||||||
pub channel_recv_timeout_microseconds: u64,
|
pub channel_recv_timeout_ms: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
|
@ -143,7 +143,7 @@ impl Default for HandlerConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
max_requests_per_iter: 10000,
|
max_requests_per_iter: 10000,
|
||||||
channel_recv_timeout_microseconds: 200,
|
channel_recv_timeout_ms: 100,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ pub fn run_request_worker(
|
||||||
let mut torrents = TorrentMaps::default();
|
let mut torrents = TorrentMaps::default();
|
||||||
let mut small_rng = SmallRng::from_entropy();
|
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 {
|
loop {
|
||||||
if let Ok((sender_index, request, src)) = request_receiver.recv_timeout(timeout) {
|
if let Ok((sender_index, request, src)) = request_receiver.recv_timeout(timeout) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue