http and ws: rename cleaning.interval to torrent_cleaning_interval

This commit is contained in:
Joakim Frostegård 2021-11-03 00:11:24 +01:00
parent afe3e2465f
commit 8871d0eec8
6 changed files with 12 additions and 11 deletions

View file

@ -59,7 +59,7 @@ pub struct ProtocolConfig {
#[serde(default)]
pub struct CleaningConfig {
/// Clean peers this often (seconds)
pub interval: u64,
pub torrent_cleaning_interval: u64,
/// Remove peers that haven't announced for this long (seconds)
pub max_peer_age: u64,
}
@ -106,7 +106,7 @@ impl Default for ProtocolConfig {
impl Default for CleaningConfig {
fn default() -> Self {
Self {
interval: 30,
torrent_cleaning_interval: 30,
max_peer_age: 1800,
}
}

View file

@ -35,7 +35,7 @@ pub async fn run_request_worker(
enclose!((config, torrents, access_list) move || async move {
torrents.borrow_mut().clean(&config, &access_list);
Some(Duration::from_secs(config.cleaning.interval))
Some(Duration::from_secs(config.cleaning.torrent_cleaning_interval))
})()
}));

View file

@ -137,7 +137,9 @@ async fn remove_closed_connections(
}
}
Some(Duration::from_secs(config.cleaning.interval))
Some(Duration::from_secs(
config.cleaning.torrent_cleaning_interval,
))
}
async fn receive_out_messages(