From 4f563dff1756408def00086f62aefd6b84f10531 Mon Sep 17 00:00:00 2001 From: Nulo Date: Tue, 13 Feb 2024 13:26:26 -0300 Subject: [PATCH] no guardar archivos de debug ocupan mucho espacio --- scraper-rs/src/main.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scraper-rs/src/main.rs b/scraper-rs/src/main.rs index 0f9efbf..dacaa95 100644 --- a/scraper-rs/src/main.rs +++ b/scraper-rs/src/main.rs @@ -225,11 +225,12 @@ async fn fetch_and_parse( Ok(p) => Ok(p), Err(err) => { let now: DateTime = Utc::now(); - let debug_path = PathBuf::from(format!("debug-{}/", now.format("%Y-%m-%d"))); - tokio::fs::create_dir_all(&debug_path).await.unwrap(); - let file_path = debug_path.join(format!("{}.html", nanoid!())); - tokio::fs::write(&file_path, &body).await.unwrap(); - tracing::debug!(error=%err, "Failed to parse, saved body at {}",file_path.display()); + // let debug_path = PathBuf::from(format!("debug-{}/", now.format("%Y-%m-%d"))); + // tokio::fs::create_dir_all(&debug_path).await.unwrap(); + // let file_path = debug_path.join(format!("{}.html", nanoid!())); + // tokio::fs::write(&file_path, &body).await.unwrap(); + // tracing::debug!(error=%err, "Failed to parse, saved body at {}",file_path.display()); + tracing::debug!(error=%err, "Failed to parse"); Err(err) } }?;