diff --git a/src/config.rs b/src/config.rs index 4418c04..8840ce1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -106,10 +106,6 @@ pub struct Config { #[arg(long, default_value_t = 3600)] pub resolve_torrent_ban: u64, - /// Ban time in seconds on torrent data download is longer than `wait_until_completed` - #[arg(long)] - pub slow_torrent_ban: Option, - /// Crawl loop delay in seconds #[arg(long, default_value_t = 60)] pub sleep: u64, @@ -122,4 +118,8 @@ pub struct Config { /// try to handle the other hashes in this queue after `n` seconds #[arg(long, default_value_t = 60)] pub wait_until_completed: u64, + + /// Ban time in seconds on torrent data download is longer than `wait_until_completed` + #[arg(long)] + pub wait_until_completed_ban: Option, } diff --git a/src/main.rs b/src/main.rs index 1159d0c..b29f667 100644 --- a/src/main.rs +++ b/src/main.rs @@ -201,8 +201,11 @@ async fn main() -> Result<()> { session .delete(librqbit::api::TorrentIdOrHash::Id(id), false) .await?; // * do not collect billions of slow torrents in the session pool - if let Some(slow_torrent_ban) = config.slow_torrent_ban { - let t = Local::now() + Duration::from_secs(slow_torrent_ban); + if let Some(wait_until_completed_ban) = + config.wait_until_completed_ban + { + let t = Local::now() + + Duration::from_secs(wait_until_completed_ban); log::debug!( "skip awaiting the completion of preload `{h}` data (`{e}`), ban until {t}." );