mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
http and ws: rename cleaning.interval to torrent_cleaning_interval
This commit is contained in:
parent
afe3e2465f
commit
8871d0eec8
6 changed files with 12 additions and 11 deletions
|
|
@ -57,11 +57,9 @@ 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,
|
||||
/// Remove connections that are older than this (seconds)
|
||||
pub max_connection_age: u64,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
|
|
@ -105,9 +103,8 @@ impl Default for ProtocolConfig {
|
|||
impl Default for CleaningConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
interval: 30,
|
||||
torrent_cleaning_interval: 30,
|
||||
max_peer_age: 1800,
|
||||
max_connection_age: 1800,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,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))
|
||||
})()
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,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_responses(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue