removed unused imports economic
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use anyhow::{Context, Result};
|
||||
use chrono::{self, Duration};
|
||||
use chrono::{self};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// src/economic/helpers.rs
|
||||
use super::types::*;
|
||||
use chrono::{Local, NaiveDate};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use chrono::{Local};
|
||||
use std::collections::{HashMap};
|
||||
|
||||
pub fn event_key(e: &EconomicEvent) -> String {
|
||||
format!("{}|{}|{}", e.date, e.time, e.event)
|
||||
|
||||
@@ -5,7 +5,4 @@ pub mod storage;
|
||||
pub mod update;
|
||||
pub mod helpers;
|
||||
|
||||
pub use types::*;
|
||||
pub use scraper::*;
|
||||
pub use update::run_full_update;
|
||||
pub use helpers::*;
|
||||
pub use update::run_full_update;
|
||||
@@ -1,8 +1,7 @@
|
||||
// src/economic/scraper.rs
|
||||
use super::types::{EconomicEvent, ScrapeResult};
|
||||
use super::types::{EconomicEvent};
|
||||
use fantoccini::Client;
|
||||
use tokio::time::{sleep, Duration};
|
||||
use chrono::{Local, NaiveDate};
|
||||
|
||||
const EXTRACTION_JS: &str = include_str!("extraction_script.js");
|
||||
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
use super::types::*;
|
||||
use super::helpers::*;
|
||||
use tokio::fs;
|
||||
use chrono::{Local, NaiveDate, Datelike};
|
||||
use chrono::{NaiveDate, Datelike};
|
||||
use std::collections::HashMap;
|
||||
use std::path::Path;
|
||||
|
||||
pub async fn scan_existing_chunks() -> anyhow::Result<Vec<ChunkInfo>> {
|
||||
let dir = std::path::Path::new("economic_events");
|
||||
@@ -112,10 +111,4 @@ pub async fn save_changes(changes: &[EventChange]) -> anyhow::Result<()> {
|
||||
fs::write(&path, serde_json::to_string_pretty(&all)?).await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn target_end_date() -> String {
|
||||
let now = Local::now().naive_local().date();
|
||||
let future = now + chrono::Duration::days(90);
|
||||
future.format("%Y-%m-%d").to_string()
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
use super::{scraper::*, storage::*, helpers::*, types::*};
|
||||
use crate::{config::Config, scraper::webdriver::ScrapeTask};
|
||||
use crate::scraper::webdriver::ChromeDriverPool;
|
||||
use chrono::{Local, NaiveDate};
|
||||
use chrono::{Local};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Runs the full update for economic data, using the provided ChromeDriver pool.
|
||||
|
||||
Reference in New Issue
Block a user