moved data capturing into cache folder

This commit is contained in:
2025-12-05 22:32:42 +01:00
parent 58a498e694
commit a6823dc938
6 changed files with 230 additions and 80 deletions

View File

@@ -7,6 +7,10 @@ pub struct DataPaths {
data_dir: PathBuf,
cache_dir: PathBuf,
logs_dir: PathBuf,
// Cache data subdirectories
cache_gleif_dir: PathBuf,
cache_openfigi_dir: PathBuf,
cache_gleif_openfigi_map_dir: PathBuf,
// Economic data subdirectories
economic_events_dir: PathBuf,
economic_changes_dir: PathBuf,
@@ -25,6 +29,11 @@ impl DataPaths {
let cache_dir = base_dir.join("cache");
let logs_dir = base_dir.join("logs");
// Cache subdirectories
let cache_gleif_dir = cache_dir.join("gleif");
let cache_openfigi_dir = cache_dir.join("openfigi");
let cache_gleif_openfigi_map_dir = cache_dir.join("glei_openfigi");
// Economic subdirectories
let economic_events_dir = data_dir.join("economic").join("events");
let economic_changes_dir = economic_events_dir.join("changes");
@@ -39,6 +48,9 @@ impl DataPaths {
fs::create_dir_all(&data_dir)?;
fs::create_dir_all(&cache_dir)?;
fs::create_dir_all(&logs_dir)?;
fs::create_dir_all(&cache_gleif_dir)?;
fs::create_dir_all(&cache_openfigi_dir)?;
fs::create_dir_all(&cache_gleif_openfigi_map_dir)?;
fs::create_dir_all(&economic_events_dir)?;
fs::create_dir_all(&economic_changes_dir)?;
fs::create_dir_all(&corporate_events_dir)?;
@@ -50,6 +62,9 @@ impl DataPaths {
data_dir,
cache_dir,
logs_dir,
cache_gleif_dir,
cache_openfigi_dir,
cache_gleif_openfigi_map_dir,
economic_events_dir,
economic_changes_dir,
corporate_events_dir,
@@ -74,6 +89,18 @@ impl DataPaths {
&self.logs_dir
}
pub fn cache_gleif_dir(&self) -> &Path {
&self.cache_gleif_dir
}
pub fn cache_openfigi_dir(&self) -> &Path {
&self.cache_openfigi_dir
}
pub fn cache_gleif_openfigi_map_dir(&self) -> &Path {
&self.cache_gleif_openfigi_map_dir
}
/// Get the economic events directory
pub fn economic_events_dir(&self) -> &Path {
&self.economic_events_dir