mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
implement slow_torrent_ban argument option
This commit is contained in:
parent
186c2b6cf1
commit
129d33f593
2 changed files with 16 additions and 4 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -198,12 +198,20 @@ async fn main() -> Result<()> {
|
|||
)
|
||||
.await
|
||||
{
|
||||
log::debug!(
|
||||
"skip awaiting the completion of preload `{h}` data (`{e}`)"
|
||||
);
|
||||
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);
|
||||
log::debug!(
|
||||
"skip awaiting the completion of preload `{h}` data (`{e}`), ban until {t}."
|
||||
);
|
||||
assert!(ban.insert(i, t).is_none());
|
||||
} else {
|
||||
log::debug!(
|
||||
"skip awaiting the completion of preload `{h}` data (`{e}`)"
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
log::debug!("torrent `{h}` preload completed.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue