Add rocksdb
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
pub mod db;
|
||||
|
||||
use tokio::fs;
|
||||
use crate::constants::{APP_CONFIG_DIR, APP_DATA_DIR, APP_DB_DATA_DIR};
|
||||
use crate::crawler::DLSITE_IMG_FOLDER;
|
||||
|
||||
|
||||
pub async fn initialize_folders() -> color_eyre::Result<()> {
|
||||
if !APP_CONFIG_DIR.exists() {
|
||||
fs::create_dir_all(APP_CONFIG_DIR.as_path()).await?;
|
||||
}
|
||||
if !APP_DATA_DIR.exists() {
|
||||
fs::create_dir_all(APP_DATA_DIR.as_path()).await?;
|
||||
}
|
||||
if !DLSITE_IMG_FOLDER.exists() {
|
||||
fs::create_dir_all(DLSITE_IMG_FOLDER.as_path()).await?;
|
||||
}
|
||||
if !APP_DB_DATA_DIR.exists() {
|
||||
fs::create_dir_all(APP_DB_DATA_DIR.as_path()).await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user