udp: request worker: use ValidUntil::new_with_now

This commit is contained in:
Joakim Frostegård 2021-11-27 18:12:19 +01:00
parent d565c6e046
commit b9bc5a2aa4
2 changed files with 2 additions and 3 deletions

View file

@ -17,7 +17,6 @@
* cargo-deny * cargo-deny
* aquatic_udp * aquatic_udp
* request worker: use `ValidUntil::new_with_now`
* look at proper cpu pinning (check that one thread gets bound per core) * look at proper cpu pinning (check that one thread gets bound per core)
* then consider so_attach_reuseport_cbpf * then consider so_attach_reuseport_cbpf
* what poll event capacity is actually needed? * what poll event capacity is actually needed?

View file

@ -121,10 +121,10 @@ pub fn run_request_worker(
} }
if iter_counter % 128 == 0 { if iter_counter % 128 == 0 {
peer_valid_until = ValidUntil::new(config.cleaning.max_peer_age);
let now = Instant::now(); let now = Instant::now();
peer_valid_until = ValidUntil::new_with_now(now, config.cleaning.max_peer_age);
if now > last_cleaning + cleaning_interval { if now > last_cleaning + cleaning_interval {
torrents.clean(&config, &state.access_list); torrents.clean(&config, &state.access_list);