mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-22 22:26:19 +00:00
Compare commits
1 commit
ad306364b7
...
5c450597d1
Author | SHA1 | Date | |
---|---|---|---|
|
5c450597d1 |
2 changed files with 2 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -16,4 +16,4 @@ target/
|
||||||
|
|
||||||
*/flamegraph.svg
|
*/flamegraph.svg
|
||||||
*/perf.data*
|
*/perf.data*
|
||||||
scraper-rs/debug*/
|
scraper-rs/debug/
|
|
@ -1,5 +1,4 @@
|
||||||
use again::RetryPolicy;
|
use again::RetryPolicy;
|
||||||
use chrono::{DateTime, Utc};
|
|
||||||
use clap::{Parser, ValueEnum};
|
use clap::{Parser, ValueEnum};
|
||||||
use cron::Schedule;
|
use cron::Schedule;
|
||||||
use db::Db;
|
use db::Db;
|
||||||
|
@ -203,8 +202,7 @@ async fn fetch_and_parse(
|
||||||
let point = match maybe_point {
|
let point = match maybe_point {
|
||||||
Ok(p) => Ok(p),
|
Ok(p) => Ok(p),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let now: DateTime<Utc> = Utc::now();
|
let debug_path = PathBuf::from("debug/");
|
||||||
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();
|
||||||
|
|
Loading…
Reference in a new issue