From 29ea9357446968a248abbc7728072e6ea8f3d61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Sat, 19 Feb 2022 14:09:24 +0100 Subject: [PATCH] udp: request workers: use config.statistics.active() --- aquatic_udp/src/workers/request.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aquatic_udp/src/workers/request.rs b/aquatic_udp/src/workers/request.rs index 6a3f40e..590f3e3 100644 --- a/aquatic_udp/src/workers/request.rs +++ b/aquatic_udp/src/workers/request.rs @@ -221,7 +221,7 @@ pub fn run_request_worker( if now > last_cleaning + cleaning_interval { torrents.clean(&config, &state.access_list); - if !statistics_update_interval.is_zero() { + if config.statistics.active() { let peers_ipv4 = torrents.ipv4.values().map(|t| t.peers.len()).sum(); let peers_ipv6 = torrents.ipv6.values().map(|t| t.peers.len()).sum(); @@ -233,7 +233,7 @@ pub fn run_request_worker( last_cleaning = now; } - if !statistics_update_interval.is_zero() + if config.statistics.active() && now > last_statistics_update + statistics_update_interval { state.statistics_ipv4.torrents[worker_index.0]