no guardar archivos de debug

ocupan mucho espacio
This commit is contained in:
Cat /dev/Nulo 2024-02-13 13:26:26 -03:00
parent 622894115c
commit 4f563dff17

View file

@ -225,11 +225,12 @@ async fn fetch_and_parse(
Ok(p) => Ok(p), Ok(p) => Ok(p),
Err(err) => { Err(err) => {
let now: DateTime<Utc> = Utc::now(); let now: DateTime<Utc> = Utc::now();
let debug_path = PathBuf::from(format!("debug-{}/", now.format("%Y-%m-%d"))); // let debug_path = PathBuf::from(format!("debug-{}/", now.format("%Y-%m-%d")));
tokio::fs::create_dir_all(&debug_path).await.unwrap(); // tokio::fs::create_dir_all(&debug_path).await.unwrap();
let file_path = debug_path.join(format!("{}.html", nanoid!())); // let file_path = debug_path.join(format!("{}.html", nanoid!()));
tokio::fs::write(&file_path, &body).await.unwrap(); // 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, saved body at {}",file_path.display());
tracing::debug!(error=%err, "Failed to parse");
Err(err) Err(err)
} }
}?; }?;