From 9a64995bf56c8f36310660ebd945674f5e093033 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 2 Aug 2025 15:51:17 +0300 Subject: [PATCH] change `clear_output_folder` position to prevent extra write operations --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 6378e88..ab5a19e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -247,6 +247,10 @@ async fn main() -> Result<()> { .delete(librqbit::api::TorrentIdOrHash::Id(id), false) .await?; + // cleanup `output_folder` only if the torrent is resolved + // to prevent extra write operations on the next iteration + preload.clear_output_folder(&i)?; + if config.debug { println!("\t\t\tadd `{i}` to index.") } @@ -260,7 +264,6 @@ async fn main() -> Result<()> { } } } - preload.clear_output_folder(&i)?; } } if config.debug {