mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
remove download_torrent_timeout as managed by parent add_torrent_timeout controller
This commit is contained in:
parent
de15a8270e
commit
cb377425a7
2 changed files with 9 additions and 29 deletions
34
src/main.rs
34
src/main.rs
|
|
@ -151,31 +151,15 @@ async fn main() -> Result<()> {
|
|||
session.update_only_files(&mt, &only_files).await?;
|
||||
session.unpause(&mt).await?;
|
||||
// await for `preload_regex` files download to continue
|
||||
match time::timeout(
|
||||
Duration::from_secs(arg.download_torrent_timeout),
|
||||
mt.wait_until_completed(),
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(r) => {
|
||||
if let Err(e) = r {
|
||||
debug.info(&format!("Skip `{i}`: `{e}`."))
|
||||
} else {
|
||||
// remove torrent from session as indexed
|
||||
session
|
||||
.delete(
|
||||
librqbit::api::TorrentIdOrHash::Id(id),
|
||||
false,
|
||||
)
|
||||
.await?;
|
||||
// cleanup irrelevant files (see rqbit#408)
|
||||
storage.cleanup(&i, Some(only_files_keep))?;
|
||||
// ignore on the next crawl iterations for this session
|
||||
index.insert(i);
|
||||
}
|
||||
}
|
||||
Err(e) => debug.info(&format!("Skip `{i}`: `{e}`.")),
|
||||
}
|
||||
mt.wait_until_completed().await?;
|
||||
// remove torrent from session as indexed
|
||||
session
|
||||
.delete(librqbit::api::TorrentIdOrHash::Id(id), false)
|
||||
.await?;
|
||||
// cleanup irrelevant files (see rqbit#408)
|
||||
storage.cleanup(&i, Some(only_files_keep))?;
|
||||
// ignore on the next crawl iterations for this session
|
||||
index.insert(i);
|
||||
}
|
||||
Ok(AddTorrentResponse::ListOnly(r)) => {
|
||||
if arg.save_torrents {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue